๐Ÿงฑ

Data structures

The way you organise information decides how easy (and fast) your program can be. Meet the toolbox every programmer uses.

Which structure fits?

Real situations, matched with the right tool.

Browser history โ†’ StackLast page in, first page out when you press Back.
Printer queue โ†’ QueueFirst document in is the first one printed.
Contacts โ†’ MapLook up a phone number instantly by name.
Organisation chart โ†’ TreeEach manager has a team below them.
Road network โ†’ GraphCities are nodes; roads are edges between them.
Task priorities โ†’ Priority queueThe most urgent task always comes out first.
๐Ÿ“š Stack in action

Undo, like in your favourite editor

A stack is a pile of plates: you add on top and take from the top. Thatโ€™s exactly how โ€œUndoโ€ remembers what you did.

undo-stack.pseudo
1BEGIN2    SET HISTORY = []3    ADD "type Hello" TO HISTORY4    ADD "make bold" TO HISTORY5    ADD "change colour" TO HISTORY6    SET LAST = POP(HISTORY)7    DISPLAY "Undo:", LAST8    DISPLAY "Still in history:", HISTORY9END

๐Ÿ“บ Data structure lessons (Phase 08)

01 Why Data Structures? ๐Ÿšง Coming soon
02 Stack ๐Ÿšง Coming soon
03 Queue ๐Ÿšง Coming soon
04 Linked List ๐Ÿšง Coming soon
05 Hash Table / Map ๐Ÿšง Coming soon
06 Tree ๐Ÿšง Coming soon
07 Binary Tree ๐Ÿšง Coming soon
08 Binary Search Tree ๐Ÿšง Coming soon
09 Heap ๐Ÿšง Coming soon
10 Priority Queue ๐Ÿšง Coming soon
11 Graph ๐Ÿšง Coming soon
12 Nodes and Edges ๐Ÿšง Coming soon
13 Directed / Undirected Graphs ๐Ÿšง Coming soon
14 Weighted Graphs ๐Ÿšง Coming soon
15 Choosing Data Structures ๐Ÿšง Coming soon