Linked lists
Build a singly linked list in C from heap nodes and next pointers: walk it, push at both ends, remove a node, reverse it and free it without leaks.
- The skill
- Build and change a linked list of heap nodes, including the head, without losing or leaking a node.
- You make
- A track list with totals, push at both ends, removal, in-place reversal and a top-five leaderboard.
Premium lesson
£7.99 a month or £59 a year. Cancel any time.
Builds on 25 Debugging C on purpose. Free to try: C Foundations and the playground.
Passed
You can now
Keep going
You have what you need for a project: Playlist as a linked list Premium 2 hours
Step 1 of 10
exercise_1.c
You've reached the good stuff.
6 exercises in this lesson, checked as you type. Premium opens every lesson after Foundations, in all four courses.
C, 32-bit: int and pointers are 4 bytes