Study Guide...for the Final

 

CS 163: Data Structures

 

 

 

#1)  The final will be comprehensive and expect thorough knowledge of linked lists, hash tables, tree, and graph data structures.  It will cover topics such as: stack, queue, and table abstract data types. You will be responsible for measuring the efficiency of an algorithm. You will need to know how to search and sort for data given a variety of different data structures.

 

#2) Emphasis will be placed on the following chapters:

 

• Chapter 4: Linked Lists

• Chapter 6,7: Design and Implementation of Abstract Data Types

• Chapter 9: Algorithm Efficiency and Sorting

• Chapter 10, 11, 12: Trees

• Chapter 13: Graphs

 

#3)  The final will also cover the lecture notes for the class.

 

#4) There will be questions asking you to modify classes  and write functions.

 

#5) The exam is closed book and closed notes.

 

#6)  Topics to study: The exam will focus on table abstract data types. Understand recursion and pointer-based implementations of hash tables, heaps, binary trees, AVL trees, and 2-3 trees. Understand the concepts behind sorting using: QuickSort, MergeSort, Insertion Sort, Selection Sort, and Exchange Sort. For graphs, understand the basics of the depth-first and breadth-first traversal algorithms.

 


Sample Questions...for the Final

 

1) Explain binary and sequential search techniques. What is the efficiency of these algorithms... for a successful and unsuccessful search?

2) Show how to calculate the Big 0h Notation for the insertion sort (best and worst cases).

3) What ADT operations that can be done on a table?

4) What is the difference between a table abstract data type, a tree, and a graph?

5) Explain the advantages and disadvantages of using linked storage for hash tables.

6) Explain each of the following algorithms (using a sample set of numbers): insertion sort, selection sort,  quicksort, and mergesort

7) Given the following numbers, in order:

5, 8, 66, 30, 11, 12, 3, 4, 6, 77, 88, 99

 

a.Draw the resulting heap after inserting all of the data items

(assume that the larger numbers should have higher priority)

b. Draw a 2-3 tree

c. Draw a 2-3-4 tree

d. Draw an AVL tree

 

8) Given a tree with the following definition:

 

struct node {

int data;

node * left_child;

node * right_child;

};

 

class binary_tree {

public:

int sum_total();     //write this function; it returns the sum total

~binary_tree();     //write the destructor

private:

node * root;

};

Write a function that will calculate the sum-total of all data values stored in the tree; use recursion!

 

9) What is the maximum height of a binary tree with 10 nodes?

10)  What are the advantages of implementing the ADT table operations with a 2-3 tree instead of a binary search tree?

11) Compare and contrast the efficiency of a 2-3, 2-3-4, and red-black tree.

12) Write a function to: a) copy a binary search tree, b) find the inorder success in a binary search tree, c) determine whether or not a tree is full