Source: https://docs.google.com/document/d/19YB4NZvstWpodns5EjOvDzwxOy56F8nSmbLTvvdyLO0/edit
Midterm 2 Review
- Singly Linked Lists and Doubly Linked Lists (with/without tails):
- Complexity of adding, removing, searching (depending on the location and the type of the list)
- How to implement these methods
- Implementing stack/queues using SLL or DLL, how to map top/front/rear with linked lists head/tail to achieve O(1) complexity.
- Adapter Pattern Design.
- Inner classes
- Inheritance and interface, idea of the polymorphism.
- What is the purpose of the iterator?
- 6 types of sorts: check, insertion, selection, merge, quick, counting sort. You should be able to:
- Understand how each of them works (invariants, algorithms for merge, insertion and quick sorts)
- Trace each sort given different input arrays (Similar to the PA5 Part 1).
- Know and understand the implementation of at least insertion, selection and quick sorts.
- Understand running times for best, average and worst cases for all 6 algorithms. You should be able to infer the running time of the checksort after working with it in PA05.
- Binary trees, tree traversals. Binary search trees operations and their running times (worst and average).
- Insert
- Delete
- Search
- Find max/min
- Find height
- Know the implementations of:
- Insert
- Search
- Find max/min
- Find height