โ† Computer Science Fundamentals learning path
Computer Science Fundamentals ยท Module 4 of 10

Data structures

Data structures organise data so operations are fast.

๐Ÿ“– Key ideas

  1. Arrays give fast access by index; inserting in the middle is slow.
  2. Linked lists insert quickly but access by index is slow.
  3. Stacks are last-in first-out; queues are first-in first-out.
  4. Hash tables give average O(1) lookups by key.
  5. Trees and graphs model hierarchies and networks.
๐Ÿ’ก Real-life example: Like storage at home: a numbered shelf (array), a chain of boxes (linked list), a pile of plates (stack), a bus queue (queue).
StackLast in, first out
QueueFirst in, first out
Hash tableKey to value with fast lookup
GraphNodes connected by edges