Skip to content

Linear Data Structures

This block teaches the most common "line of items" structures you’ll use everywhere: arrays, linked lists, stacks, and queues.

You'll learn when each one is a good fit, and you’ll build a linked list yourself so the ideas feel real (not magic).

What this block is for

Linear structures are the foundation for later topics (trees, graphs, hash tables).
If you understand how these work and what they cost, your future code choices get much easier.

What you should get from this block

  • Explain (in simple words) when to use an array vs a linked list.
  • Understand why some operations are fast and others are slow (based on how items are stored).
  • Implement a linked list from scratch and confidently trace what your code is doing.
  • Use stacks and queues correctly for real tasks (undo, backtracking, BFS-style processing, buffering).

How to study (simple routine)

Slides → notes → videos → practice.
Always do a tiny hand-trace (3–6 items) before coding.

Key topics

  • Arrays vs. Linked Lists (fundamentals)
    Two ways to store a sequence: fast access vs easy change.
    Open →

  • Build a Linked List from scratch
    Create nodes, manage head, and implement insert/delete safely.
    Open →

  • Stacks and Queues
    Two simple rules (LIFO vs FIFO) that solve many practical problems.
    Open →

  • Practice
    Short tasks to make the concepts stick and catch mistakes early.
    Go to practice →

  1. Read one topic and write down 2–3 “rules of thumb” in your own words.
  2. Do 2–4 small tasks and hand-trace at least one example.
  3. After finishing, rewrite one solution to make it clearer (better names, fewer special cases, simpler steps).

Before moving on

You’re ready for the next block when you can:

  • Choose between array / ArrayList / linked list and justify your choice in one sentence.
  • Trace insertion and deletion in a linked list without getting lost.
  • Explain what stack vs queue means, and recognize which one a problem needs.

Good programmers don’t just solve problems; they choose structures that make the solution natural.

Motivational