DSA and problem solving

Stage 2 of 8 · 6 lessons · ~2 months

Arrays, hashing, linked lists, stacks and queues

Learn the linear structures and hash maps that most problems are built on, and exactly what your language gives you for each. Counting, grouping and lookup problems all start here.

Start: Arrays, dynamic arrays and strings

Lessons· one lesson for each topic, in this order

  1. 1Arrays, dynamic arrays and strings
  2. 2Singly and doubly linked lists
  3. 3Stacks, queues and deques
  4. 4Hash maps and sets
  5. 5Prefix sums and frequency counts
  6. 6Your language's built-in collections and their costs

Start with· follow one of these

Practise

Keep handy

  • Array, Map and Set pages: what each method does and when a Map beats a plain object

Also worth your time

Before moving on: Implement a dynamic array, a linked list and a hash map with chaining from scratch, state the Big-O of every operation, then solve 25 easy and 5 medium array, string, hash map, linked list and stack problems.

Tauseef's advice
Build each structure yourself once, because that is where the costs stop being facts you memorised. JavaScript has no built-in queue: array shift() is O(n), so write a small queue with a head index and keep it as a snippet you trust.

Mark this stage as not done?