Learn C Programming

Lesson 4 of 9 · Dynamic Memory

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

  1. One struct on the heap
  2. An array of structs on the heap
  3. A node that points at the next node
  4. Push front: the new node becomes the head
  5. Walk, count and find
  6. Freeing a list: save next before free
  7. A list or an array?
  8. Two links per node: a first look at a tree