COMP1511 17s2
— Lecture 19 —

Andrew Bennett
<andrew.bennett@unsw.edu.au>

More Linked Lists
Testing + Version Control

Don’t panic!

assignment 2 groups

update your Game.h

Nodes and Lists

typedef struct _node *Node;
typedef struct _list {
    Node head;
} list;
typedef struct _node {
    int value;
    Node next;
} node;

Node pointers vs allocated nodes

reference to a node

vs

making (allocating) a new node

Why do we use the list struct?

how do we know where the list starts?

when might that change?

void functions?

Using Lists

Going through every node

list length?

list sum?

printing a list?

Stopping at a certain node/position

add to end?

add to middle?