The eleven core data structures, written to the course standard: prerequisites, observable outcomes, a terminology table, the mechanism worked through by hand, a complete runnable lab, independent practice with hidden answers, and a demonstrable finish line.

This folder is about how each structure works and what it costs. The companion folder 04-patterns is about recognising which structure or technique a problem calls for — several patterns there link back here rather than re-deriving the mechanics.

Every lab in this folder has been run and its output checked against the documented “Expected output”.

The structures

Ordered so each builds on the last: dynamic arrays assume arrays, graph searching uses stacks and queues, heaps assume trees, and tries assume both trees and hash maps.

  1. Arrays — contiguous memory, O(1) indexing, and why insertion in the middle is O(n)
  2. Dynamic Arrays — geometric growth, and the amortised argument that makes append O(1)
  3. Hash Maps & Hash Sets — hashing, collision resolution, load factor, and when O(1) degrades
  4. Linked Lists — pointer-based nodes, O(1) splicing, and the cost of losing random access
  5. Stacks and Queues — LIFO and FIFO, and the problems whose shape each one matches
  6. Trees — hierarchy, height vs. size, and why an unbalanced BST degenerates to a list
    • Tree Traversal — pre-order, in-order, post-order, level-order, and what each one is for
  7. Heaps & Priority Queues — the heap property, sift-up/sift-down, and O(log n) extreme-value access
  8. Tries / Prefix Trees — shared prefixes, and trading memory for prefix queries
  9. Graphs — vertices and edges, adjacency list vs. matrix, and the space/time tradeoff between them
  10. Union-Find — dynamic connectivity, path compression, and union by rank

Question banks

One bank per lesson: micro-questions with the answers hidden behind toggles, for closed-book recall rather than reading. Method explained in the arrays bank.


  • DSA notes — the parent folder
  • 04-patterns — the 15 recurring problem-solving patterns
  • 03-algorithms — sorting, searching, and graph algorithms built on these structures
↑ Back to Data Structures & Algorithms