Topics for Exam 2
CS 241: Data Structures,
Exam will include exercises from chapters 6-10 and 11.3 in the text, vocabulary, questions on material covered
in class, and questions on labs (perhaps writing very short snippets of code).
Chapter 6: Linked Structures
- What is a linked list?
- Iterative implementation of a list operations, e.g. add, remove, contains
- Compare to ArrayList implementation. When is one
better than the other?
- How do you maintain a sorted linked list (see Card lab).
Chapter 7: Complexity Analysis of Algorithms
- How do you compare algorithms?
- Costs: space and time.
- Asymptotic notation. big-theta (Θ), big-Oh (&Omicron), and big-Omega (Ω)
- Know relative behavior of common functions such as
an, na, log(n), n!, etc
- Know how to calculate the complexity of simple
algorithms (e.g. loops, nested loops)
- Know the simple series: arithmetic (sumk k),
geometric (sumk xk), harmonic
- Know basic log identities, i.e. expand log(ab), log(a/b),
Chapter 8: Searching and Sorting
- Binary search
- Comparable Interface
- Sorting algorithms: bubble, stooge, insertion, selection, merge, quick
- Compare sorts based on: complexity, stability, in-place, comparison,
divide and conquer, swapping adjacent items, special cases.
Chapter 9: Recursion
- What is the structure of an inductive proof?
- Induction problems - see examples from homework and class.
- Know how to calculate the complexity of a simple recursive
program (e.g. using telescoping)
- Recursive implementation of a linked list, e.g. add, remove
- Compare and contrast dynamic programming to recursion. Recall
Chapters 10 and 11: Trees: General and Binary
- Terminology: root, children, leaf node, internal node, level, depth, degenerate tree, (proper) descendants, (proper) ancestors, siblings,height, full tree, perfect tree, binary tree, binary search tree, subtree.
- Characteristics of perfect binary tree - what is relationship between
height and the number of nodes?
- Traversing: pre-order, post-order, in-order, level-order
- Examples: decision trees, game trees (minimax), binary search
- Other functions on binary trees:
- Inserting a value into the tree.
- Searching a tree to see if an item is in it.
- Finding the height of a tree.
- Printing the tree structure - using parenthesis or
as a tree on its side.