<aside>
📋
L2 — Declare Your Intentions, Not Your Actions covers Abstract Data Types (ADTs) as language-independent interfaces for data structures. Introduces the common ADTs: stacks, queues, priority queues, lists, sets, and maps — their operations, use cases, implementations, and complexities.
</aside>
📋 At a Glance
- [ ] Define what an ADT is and how it relates to interfaces in OOP
- [ ] Explain encapsulation and why separating interface from implementation matters
- [ ] List the 4 operations of a stack and know LIFO ordering
- [ ] Implement a stack using an array (with top pointer) — all ops Θ(1)
- [ ] Describe 3 uses of stacks: reversing arrays, balancing parentheses, evaluating expressions
- [ ] Trace the two-stack algorithm for evaluating arithmetic expressions
- [ ] List the 4 operations of a queue and know FIFO ordering
- [ ] List the 3 operations of a priority queue (insert, findMin, deleteMin)
- [ ] Know that heaps are the most efficient priority queue implementation (O(log n) insert/delete)
- [ ] Distinguish list, set, and map ADTs by their properties and operations
- [ ] Know HashSet vs TreeSet trade-offs, and that maps use binary trees or hash tables
- [ ] Apply "program to interfaces, not implementations" in Java
- [ ] Complete Tutorial 2 questions (Q1–Q7 + starred questions)
1. Encapsulation and the OO Methodology
In object-oriented programming, you separate the interface from the implementation:
- The implementation is hidden (encapsulated) and can be changed without affecting how the class is used