Back to CS 3137 Home Page
Final exam topics from lecture -- CS 3137
Please note: Below are topics that I covered in lecture -- I'm providing them as a check list to help you study for the final exam. You are also responsible for ideas from the homework theory and programming. You are not required to memorize details from the Weiss interface, though you could be asked to write methods or parts of classes in Java.
I am dividing the list between topics before and after the midterm (the topics before the midterm were previously in the midterm study guide). The final exam will be comprehensive -- covering all material in the course -- but material after the midterm will be weighted somewhat more heavily.
Topics before the midterm
Running Time
- Simplified model of computation
- Counting operations to estimate running time-- examples
- linear search
- binary search
- Big-Oh, big-Theta, big-Omega, little-Oh
- Big-Oh classes: linear, logarithmic, etc.
- Example of running time using recursion: efficient exponentiation
Lists
- List ADT
- Array implementation -- running times for operations
- Linked list implementation -- running times for operations
- Applications:
- Polynomial ADT
- Radix sort
- Other variants:
- Doubly-linked lists, circular list
- Cursor implementation -- idea only, no details
- Stack ADT
- Stack operations
- Array and linked list implementations
- Running times
- Applications
- Balancing symbols
- Evaluating postfix expressions
- Implementing recursion, problems with recursion
- Activation record/stack frame
- Tail recursion
- Fibonacci example -- exponential algorithm
- Queue ADT
- Array and linked list implementations
Trees
- Definitions:
- Parent, child, leaf, root
- Path, length of path, height of node/tree, depth of node/tree
- Implementation of general tree
- Binary Trees
- Inorder, postorder, preorder traversal
- Example: expression trees
- Infix, postfix, prefix notation
- Construction of expression tree from postfix expression
- Binary Search Trees
- Ordering property
- Example of induction: full binary tree of height h has 2^(h+1)-1 nodes
- Operations and running times
- In class: find, findMin, findMax, insert, remove
- In homework: findKth, findSuccessor
- AVL Trees
- Balance condition
- Rebalancing after insertion: single and double rotations
- Tries
- Standard trie
- Operations and running times: find, insert
- Lazy deletion
- Number of nodes
- Compressed trie
Hashing
- Idea of hashing, average running time
- Definitions: key, hash function, buckets, collision, collision resolution
- Choice of hash function
- Not of midterm: collision resolution strategies
Topics after the midterm
Hashing, continued
- Collision resolution strategies
- Separate chaining
- Open addressing methods: linear probing, quadratic probing, double hashing
- Load factor issues for various methods
- Rehashing
Lempel-Ziv Compression
- Details of trie implementation
- How Lempel-Ziv encoding achieves file compression
- Encoding and decoding: algorithms and data structures
Priority Queues (Heaps)
- Operations: insert, deleteMin
- Binary heap implementation
- Heap-order property
- Structure property
- Implementation of insert and deleteMin operations
- Running times for insert and deleteMin operations
- Other heap operations
- buildHeap -- proof of O(N) running time
- Hash/Heap data structure to efficiently implement extra operations -- decreaseKey(p,delta), increaseKey(p,delta), delete(p) -- where p is position and delta is a positive amount
- Selection algorithms using heaps: finding kth smallest number in a list of N numbers
- Build min-heap with N numbers, perform k deleteMins -- O(N + k log N)
- Using max-heap with k numbers -- O(N log k)
Sorting
- Insertion sort
- Best case, worse case running times
- Average case running time: proof using inversions
- Quicksort
- Partitioning, pivot element
- Picking the pivot: bad idea (choosing first element), safe idea (random element), median-of-three
- Partitioning strategy used by Weiss
- Analysis of Quicksort using recurrence relations: best case, worst case, average case
- Convex hull algorithm -- similar to Quicksort
- Shell sort
- Increment sequence
- State result only: for increment sequence with hk = 2k - 1, worst case running time is O(N3/2)
- Mergesort
- Implementation, space requirement
- Running time analysis
- Heapsort: implementation, worst case running time
- Worst case general lower bound for sorting
- Statement of lower bound result
- Decision tree proof of lower bound
- Why running time for bucket sort does not contradict general lower bound result
Disjoint Set Data Structure
- Equivalence relations and equivalence classes
- Operations to dynamically build equivalence relation: find(a), union(a,b)
- Implementation of Disjoint Set data structure
- Representing forest of trees using array
- Implementing union and find operations
- Worst case running time for basic data structure: O(MN) for N entries, M operations
- Smart union algorithms:
- Union-by-size, union-by-height
- Improved worst case running time: O(M log N) for N entries, M operations
- Path compression
- Applications (algorithms for the following are actually the same)
- Building a maze with exactly one path from start to end (but many false paths)
- Hierarchical clustering
Graph Algorithms
- Basic graph definitions: vertex set, edge set, directed vs. undirected graphs, weighted vs. unweighted, paths and cycles
- Applications of graphs
- Representations of graphs
- adjacency matrix, adjacency lists
- space requirements
- Topological sort
- When is topological sort possible?
- Efficient algorithm using queue, running time
- Unweighted shortest paths
- Breadth first search starting at source vertex -- generalizes level-order search of trees
- Efficient implementation using queue, running time
- Book-keeping to reconstruct paths
- Dijkstra's algorithm for smallest weighted paths
- Need non-negative edge weights
- Known vs. unknown vertices
- Algorithm: greedy selection, update rule
- Two implementation strategies using priority queues: you should be able to describe at least one of them (say, the one you used in your final homework) and give the worst case running time
- Not on final exam -- ideas about why Dijkstra's algorithm is correct
- Not on final exam -- how to modify Dijkstra to allow for multiple shortest paths
- Minimum spanning tree algorithms
- Prim, Kruskal
- Running times: O(|E| log |V|) in both cases
- Depth-first search of graph
- Recursive implementation -- generalizes pre-order search of tree
- Running time for connected graph: O(|E|)
- Depth-first forest to find connected components of graph
- Application: finding Euler circuit
- Possible if and only if degree(v) even for all v
- Algorithm using depth-first search and splicing together paths