CS 3610 Midterm Review
Analysis of time complexity Iterative algorithms Sum up individual components Recursive algorithms The time complexity is commonly expressed as a recursive equation We can solve it be repeated replacements
Analysis of time complexity Worst case cost Best case cost Average case \big-O, \big-Omega, \big-Theta notations
Big-O, big-Omega, big-Theta Definitions Proof
STL (C++98) overview Three basic components of the STL: Containers, iterators, and algorithms Basic concepts of sequence containers: vector, deque, list Functionalities Basic operations Basic concepts of iterators
Recursions Recursive definitions, recursive algorithms and recursive functions the base case and the general case of a recursive definition how to design recursive algorithms Examples: Fibonacci number, tower of Hanoi, etc.
Recursions Recursion vs. iteration The concept of backtracking Efficiency issue, general-purpose conversion (won’t show up in the exam) Simple conversions (may show up) The concept of backtracking Examples; understand the procedure. Similarity and difference w.r.t. depth-first search.
Generic Trees Definitions Terminology Root + disjoint subtrees Terminology Height, degree of a node, degree of a tree, level of a node, Left child/right sibling representation
Binary trees Properties (# of leaf nodes, max # of nodes at certain level, max # of nodes for certain height) Complete vs. full binary trees Array representation of complete binary trees Linked representation of binary trees
Binary tree traversals Different orders Inorder Preorder Postorder Level-order (won’t show up)
Recursion vs. iteration Recursive programs, Calculate the number of leave nodes, height of a binary tree, etc. Inorder, preorder, postorder traversals The iterative version Inorder, preorder, postorder
Binary search trees Basic operations: Complexities of the operations Search, insertion, deletion, finding the minimum, finding the maximum, inorder traversal. Complexities of the operations
AVL trees Basic operations: Balance a tree after insertion Definition; balance factor Search, insertion, deletion, finding the minimum, finding the maximum, inorder traversal. Balance a tree after insertion Single rotation; when to happen, how to do it? Double rotation; when to happen, how to do it?
Heap Heap (Max-heap vs. Min-heap) Complexities Heap property, representation, height, indexes Operations on heaps: insertion (bubble up), Delete-max (bubble down), build a heap (bottom up) heap-sort Complexities
B-trees m-way search trees: generalization of binary search trees Definition of b-trees Search a key in a b-tree Insert a new key in a b-tree May need to split a node, and move up the median key to the parent Delete a key in a b-tree May need rotation & merge
Structure of the exam Definitions/basic properties (20-30%) Operations on certain inputs (20-30%) Code analysis (20-30%) Code writing (20-30%) Other