Module 14 · Dynamic Memory
Structs on the Heap, and a Linked List to Finish
Free with an accountReading
Maria's shop takes orders all day. New orders join the back of the queue, and finished ones leave from the front. At nine she has none; at noon she may have forty.
Sign in to read
This lesson is free, with an account
An account costs nothing and opens every lesson in this track that is not marked Pro, on every device you read on.
What is inside Structs on the Heap, and a Linked List to Finish
- One struct on the heap
- An array of structs on the heap
- A node that points at the next node
- Push front: the new node becomes the head
- Walk, count and find
- Freeing a list: save next before free
- A list or an array?
- Two links per node: a first look at a tree