Challenge 1: Building, Printing, and Freeing a Linked List — Possible Solution ==================================================================== #include #include typedef struct Node { int value; struct Node *next; } Node; Node *push_front(Node *head, int value) { Node *n = malloc(sizeof(Node)); n->value = value; n->next = head; return n; } void free_list(Node *head) { while (head != NULL) { Node *next = head->next; free(head); head = next; } } int main() { Node *head = NULL; head = push_front(head, 3); head = push_front(head, 2); head = push_front(head, 1); for (Node *cur = head; cur != NULL; cur = cur->next) { printf("%d\n", cur->value); } free_list(head); return 0; } Output: 1 2 3 WHY THIS WORKS AS AN ANSWER ------------------------------ Each push_front call prepends a new node, so the three calls with 3, then 2, then 1 produce the list in the order 1 -> 2 -> 3 (the most recently pushed value ends up at the front) -- exactly what the traversal prints. free_list is called only after every use of the list is complete, following the chapter's own save-next-before-freeing pattern to release every node without leaking or reading freed memory.