Download presentation
Presentation is loading. Please wait.
Published byFrancine Gilmore Modified over 9 years ago
1
Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming
2
Final Exam (Wed 12/3) 25%: Lectures 1 - 7 25%: Lectures 8 - 15 50%: Lectures 16 - 22
3
Strings and BitVectors Three characteristics of a proper type Two major advantages of C++ strings over C strings How to set/unset/test nth bit in a char
4
Hash functions and templates Hash functions Description Properties Three design principles for hashing a sequence of keys Implement simple template classes/functions
5
Search Algorithms Definition of invariants Big “O” notation (worst case running time)
6
Linked Lists and Deques List vs. vector vs. deque Implement list operations Why multiple iterators for a given class pContainers vs. aContainers How to compute the size of a deque and why
7
Stacks and Queues Implement of DFS and BFS in pseudo code How to implement a queue with a stack How to implement a stack with a queue
8
Function Objects and Generic Algorithms Advantages of function objects Implement generic copy, find, max, sort Running time of generic sort
9
Iterators and Generic Set Algorithms Types of iterators and when to use what Conceptual understanding of set operations Implement union, intersection, difference, containment, merge
10
Sets and Maps How to use set operations to find out words not in a dictionary How to use sets to implement maps How to use maps to implement linked lists and trees
11
Trees 1 Definitions: graph, tree, depth, leaf, binary tree, complete binary tree, partially ordered tree, heap Traversals: preorder, postorder, levelorder, inorder How to use nodes listed in different orders to uniquely identify a tree
12
Trees 1 Total number of vertices in a complete binary tree Total number of leafs in a complete binary tree What if we have a complete tri- nary tree?
13
Trees 1 How to use a vector to represent a complete binary tree How do you access parent, left child, and right child? Heap operations Push (bottom up) Pop (top down)
14
Trees 1 Heap operations Push (bottom up) Pop (top down)
15
Trees 2 Tree navigators vs. iterators For a complete binary tree, which node is the first node for an inorder traversal? Which node is the last?
16
Trees 2 For a complete binary tree, which node is the first node for a preorder traversal? Which node is the last?
17
Trees 2 For a complete binary tree, which node is the first node for a postorder traversal? Which node is the last?
18
Trees 2 For a complete binary tree, which node is the first node for a levelorder traversal? Which node is the last? How to implement a levelorder binary tree iterator
19
Trees 3 How to store a tree in a file How to perform node insertion and removal
20
Trees 4 Definition: totally ordered tree How to perform a binary tree with a binary search tree Best and worst running time of binary search via a binary search tree
21
Trees 4 How to improve the average running time of binary search via a binary search tree
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.