Final Exam Topics Topic Text Chapter -------------------- ------------- Algorithmic Pseudo-code........... 2 Rate of Growth of Functions and Asymptotic Notation........... 3 Recurrences....................... 4 The substitution method......... 4.1 The recursion-tree method....... 4.2 The master method............... 4.3 Sorting Algorithms Insertion-sort.................. 2 Merge-sort...................... 2 Heap-sort....................... 6.1-6.4 Quicksort....................... 7 Quicksort and Partition....... 7.1 Quicksort performance......... 7.2 Randomized Quicksort.......... 7.3 Sorting in Linear Time.......... 8 Lower bounds for sorting...... 8.1 Counting sort................. 8.2 Radix sort.................... 8.3 Bucket sort................... 8.4 Dynamic sets Priority Queue Implementations Binary Heaps.................. 6.5 Insert Extract-Min Binomial Heaps................ 19 (after midterm) Binomial Trees Binomial-Link Union Insert Extract-Min Decrease-Key Delete Fibonacci Heaps............... 20 (after midterm) Structure of Fibonacci Heaps Unordered binomial trees The potential function The maximum degree Mergeable-heap operations Insert, Find Minimum, Union Extract-Min, Consolidate Decrease-Key, Delete Bounding the maximum degree Elementary Data Structures...... 10 Stacks and Queues............. 10.1 Linked Lists.................. 10.2 Implementing Pointers & Objs.. 10.3 Representing Rooted Trees..... 10.4 Hash Tables..................... 11 Direct-address tables......... 11.1 Hash Tables................... 11.2 Collision Resolution Chaining Open Addressing........... 11.4 Hash Functions (skip 11.3.3).. 11.3 Binary Search Trees............. 12.1-12.3 Tree-Walk Search Insert Delete Minimum Successor Red-Black Trees................. 13 Red-Black Properties.......... 13.1 Rotations..................... 13.2 Insertion (and Fixup)......... 13.3 Deletion (and Fixup).......... 13.4 --------- Material above was on midterm ------ B-Trees......................... 18 Definition.................... 18.1 Search........................ 18.2 Insert........................ 18.2 Split-Child Insert-Non-Full Delete........................ 18.3 Data Structures for Disjoint Sets 21 (may not be on final) Disjoint Set Operations....... 21.1 Linked-List Representation.... 21.2 Disjoint Set Forests.......... 21.3 Topic Text Chapter -------------------- ------------- Algorithm Analysis Dynamic Programming............. 15 What key ingredients are needed to solve a problem by dynamic programming? ans: optimal substructure + overlapping subproblems Assembly-line scheduling...... 15.1 Matrix-chain Multiplication... 15.2 Elements of Dynamic Programming 15.3 Memoization (what is it?) Greedy Algorithms............... 16 What are two key ingredients are needed to solve a problem by a greedy algorithm? ans: greedy-choice property + optimal substructure Activity-selection Problem.... 16.1 Elements of Greedy Strategy... 16.2 Huffman Codes................. 16.3 Amortized Analysis.............. 17.1-17.3 Aggregate analysis The accounting method The potential method Graphs Implementations................. 22.1 Adjacency List Adjacency Matrix Graph Search Breadth-First................. 22.2 Depth-First................... 22.3 Topological Sort............ 22.4 Minimum Spanning Trees.......... 23 Generic-MST safe edges light edges MST-Kruskal MST-Prim Single-Source Shortest Paths.... 24.1-24.3 Bellman-Ford Algorithm DAG Algorithm Dijkstra's Algorithm All-Pairs Shortest Paths........ 25.1-25.2 Shortest paths and matrix multiplication The Floyd-Warshall Algorithm Possible Types of Exam Problems: (1) Writing Pseudocode (2) Runtime analysis of algorithms (3) You should be able to trace the algorithms and operations on the data structures that we have discussed. (4) Short answer (5) "Prove that ..." Especially questions from the Exercises and Problems in the Assignments. Materials allowed at exam: Two 4"x6" note cards (or equivalent) The following list contains examples of the kinds of questions listed above. The following is a list of Exercises and Problems from the text. Questions like these will appear on exams (in a slightly altered form). If they fall into one of the categories above, that is noted; the ones that have appeared in class assignments are marked with *'s. Page 13 Exercises: 1.2-2 (4) (but easier to calculate) 1.2-3 (4)* (but easier to calculate) Problems: 1-1 (first column) (4)* Pages 20-21 Exercises: 2.1-1 (3) 2.1-2 (1) 2.1-3 (1,5) Page 27 Exercises: 2.2-3 (2) Pages 36-37 Exercises: 2.3-2 (1)* 2.3-5 (2)* Page 50 Exercises: 3.1-4 (5)* 3.1-5 (5)* Page 57 Exercises: 3.2-3 (5)* 3.2-7 (5)* Pages 57-58 Problems: 3-1 parts a., b., and c. (5)* Page 67 Exercises: 4.1-1 (5) Page 75 Exercises: 4.3-1 (4) 4.3-3 (5) Pages 129-130 Exercises: 6.1-1 (4) 6.1-2 (5)* 6.1-5 (4) 6.1-6 (4) Page 135 Exercises: 6.3-1 (3) 6.3-2 (4) 6.3-3 (5)* (too hard for exam) Pages 136,138 Exercises: 6.4-1 (3) Pages 140-142 Exercises: 6.5-1 (3) 6.5-2 (3) 6.5-3 (1)* (Part 1, Assignment 3) Page 148 Exercises: 7.1-1 (3) Page 153 Exercises: 7.2-1 (5) Pages 167-168 Exercises: 8.1-1 (4) 8.1-2 (5) (in Ex. 3.2-3 above) Pages 167-168 Exercises: 8.3-1 (3) Page 177 Exercises: 8.4-1 (3) Pages 228-229 Exercises: 11.2-2 (3) Pages 244-245 Exercises: 11.4-1 (3) 11.4-2 (1) Page 256 Exercises: 12.1-1 (4) 12.1-2 (4) 12.1-4 (1) 12.1-5 (5) Pages 259-260 Exercises: 12.2-1 (4) 12.2-2 (1) 12.2-3 (1) 12.2-5 (5) Trace BST insertion/deletion (3) Pages 276-277 Exercises: 13.1-2 (3,4) 13.1-5 (5)* 13.1-6 (4)* 13.1-7 (4) Pages 278-279 Exercises: 13.2-1 (1)* (Assignment 4) Page 287 Exercises: 13.3-1 (4) 13.3-2 (3)* 13.3-3 (4) -------- material above was on midterm ------------ Pages 293-294 Exercises: 13.4-3 (3) (like Assignment 4, last problem) 13.4-5 (4) Pages 330-331 Exercises: Note: 15.1.1 is a good _kind_ of question 15.1-1 (1) ans: like Print-Path p. 538 15.1-2 (5) 15.1-3 (5) (Too hard for an exam) Pages 338-339 Exercises: 15.2-1 (3) (a bit too hard for an exam) 15.2-2 (1) 15.2-5 (5) Pages 349-350 Exercises: 15.3-2 (4) (but for 8 elements) 15.3-4 (4) Pages 378-379 Exercises: 16.1-1 (1,2) (too hard for an exam) Page 384 Exercises: 16.2-1 (5) (too hard for an exam) 16.2-2 (1,2) (too hard for an exam) Page 392 Exercises: 16.3-1 (5) (too hard for an exam) 16.3-2 (3) (i.e. trace Huffman) Pages 409-410 Exercises: 17.1-1 (4) 17.1-3 (4) Pages 409-410 Exercises: 17.3-2 (4) Pages 440-441 Exercises: 18.1-1 (4) 18.1-2 (4) 18.1-4 (5) 18.1-5 (4) Pages 447-449 Exercises: 18.2-1 (3) (Trace B-tree insertion/deletion) 18.2-3 (1) Page 452 Exercises: 18.3-1 (3) (Trace B-tree insertion/deletion) 18.3-2 (1)* (Assignment 5, I won't ask it on the final) Page 461 Exercises: 19.1-1 (4) 19.1-2 (4) Pages 471-473 Exercises: 19.2-1 (1)* (merge linked list) 19.2-2 (3) 19.2-3 (3) Pages 488-489 Exercises: 20.2-1 (3) Page 501 Exercises: (may not be on final) 21.1-1 (3) (too long for an exam) 21.1-3 (2) Pages 504-505 Exercises: (may not be on final) 21.2-1 (1) (a bit too long for an exam) 21.2-2 (3) (a bit too long for an exam) 21.2-4 (2) Page 509 Exercises: (may not be on final) 21.3-1 (3) (too long for an exam) 21.3-2 (1) Pages 530-531 Exercises: 22.1-1 (4) 22.1-2 (4) 22.1-5 (1,2) Pages 538-539 Exercises: 22.2-1 (3) 22.2-2 (3) 22.2-3 (2) Pages 547-549 Exercises: 22.3-2 (3) 22.3-3 (3) 22.3-6 (1) Pages 551-552 Exercises: 22.4-1 (3) (won't ask this one) Chapter 23: Be able to trace Prim's and Kruskal's algorithms (3) Pages 591-592 Exercises: 24.1-1 (3) Pages 600-601 Exercises: 24.3-1 (3)* 24.3-3 (4) Pages 634-635 Exercises: 25.2-1 (3)* (like Part II of Assignment 9) 25.2-4 (5) (Useful, but won't ask it)