Data Structures
Finals Review
Notes:
This materials is just meant to give you an idea of important topics. You are still responsible for learning from the following materials:In order to prepare for the final exam, I suggest that after learning the material, you try answering the review questions and homework/recitation assignments.
- Class notes
 - Reading assignments
 - Review questions
 - Material covered in recitation
 - Assignments
 Draw figures, etc.
- Given a binary search tree, show the order in which nodes are visited in the following traversals (i) preorder, (ii) postorder, (iii) inorder, and (iv) level-order.
 - Given a sequence of insert and delete operations on (i) a BST, (ii) an AVL tree, (iii) a hash table (open addressing or chaining), or (iv) a B-tree, draw a figure showing the state of the appropriate data structure.
 - Given a sequence of insert and search operations on a self-adjusting BST (single rotations or move to root), draw the tree.
 - Given a sequence of insert (push) and DeleteMin (pop) on a Min heap, draw the heap, using pointers and using an array.
 - Given an array, draw figures to show the steps in the heap initialization algorithm.
 - Given a graph, show its representations using an adjacency list and an adjacency matrix.
 Write code fragments
- Write code for the following: (i) tree traversals, (ii) insert, delete, and search on BST, AVL tree, self-adjusting BST, and hash tables, (iii) push, pop, and top on max and min heaps, (iv) heap initialization, (v) rotations on different types of BSTs, (vi) largest node, smallest node, etc, of a BST.
 - Given a problem, write code to solve it using STL implementations of data structures studied in this class, over the entire semester.
 Times complexities
- Give the time complexities for performing various operations on all the data structures that we have studied in this class, over the entire semester.
 - Given an application, choose a suitable data structure for it, giving a rational justification for your choice.
 Proofs and analysis
- Perform amortized and average case time complexity analyses.
 - Given a recursive function, give the time complexity of executing it as a function of its arguments.
 - Derive the expected and worst case time complexities for insertion, deletion, and search on BST, AVL trees, self-adjusting BST, and hash tables.
 - Derive bounds on the height, number of nodes, and number of leaves of binary trees, BST, AVL trees, and heaps.
 - Derive the time complexity of push, pop, top, and initialization of a heap.
 - Prove properties for different types of trees.
 - Prove that algorithms with certain time complexities are impossible, using the fact that comparison base sorting cannot be performed in time O(n). (Possibly as a bonus point question)
 - Disprove the correctness of some statement, using a counterexample.
 - Determine the index of the children and the parent of a node, in the array representation of a complete tree, which need not be a binary tree, and prove that your answer is correct, using induction.
 
Last modified: 23 Nov 2014