Download presentation
Presentation is loading. Please wait.
1
CS 3610 Midterm Review
2
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
3
Analysis of time complexity
Worst case cost Best case cost Average case \big-O, \big-Omega, \big-Theta notations
4
Big-O, big-Omega, big-Theta
Definitions Proof
5
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
6
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.
7
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.
8
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
9
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
10
Binary tree traversals
Different orders Inorder Preorder Postorder Level-order (won’t show up)
11
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
12
Binary search trees Basic operations: Complexities of the operations
Search, insertion, deletion, finding the minimum, finding the maximum, inorder traversal. Complexities of the operations
13
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?
14
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
15
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
16
Structure of the exam Definitions/basic properties (20-30%)
Operations on certain inputs (20-30%) Code analysis (20-30%) Code writing (20-30%) Other
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.