← All chapters
Chapter 04Weeks 5–6Phase 2 ~2.8 h
Linked Lists
Pointers and the heap, then singly and doubly linked lists: insert, delete, search, traverse.
- 4.1Pointers, new/delete & the HeapA pointer holds an address. new asks the heap for memory that lives until you delete it. Master this and linked lists become easy. 45 minmedium
- 4.2Singly Linked ListNodes on the heap, each pointing to the next. Insert at front, end or a position, delete by value, search and traverse, plus the dummy-node trick and the classic pitfalls. 75 minmedium
- 4.3Doubly Linked ListEach node points both forward and backward. You can walk in both directions and delete a node knowing only its address, at the cost of one extra pointer per node. 50 minmedium