Computer Science · Cheatsheet
Topic 4 · Abstract Data Structures (HL)
Chapter 1 · Stacks, queues & linked lists
📋 Reference · always available
Stack (LIFO)
push/pop at the top. Undo, call stack.
Queue (FIFO)
enqueue rear, dequeue front. Scheduling.
Array
O(1) access by index; O(n) front/middle insert (shifting).
Linked list
Nodes + next pointers; O(1) insert, but no direct access.
Trade-off
Random access → array; lots of insert/delete → linked list.