CS 106B Lecture Notes - Lecture 19: Linked List, Null Pointer
Document Summary
Midterm results: median of 50 points, results will be posted right after class today. Can request regrade by friday (entire exam might be graded) Linked list: a linked list is a chain of nodes, each element is stored separately from the rest, the elements are then chained together into a sequence, practice with pointers. Create a new pointer that points to a node. Use -> to set the value of the node to which the pointer points. If you create another pointer and set it equal to the original one, both of them point to the same object. You must have (cid:498)delete(cid:499) statements when you take memory. Stack for yourself: has only one pointer that points to the stack, to add another value to stack. Create new node and point to the new value. Point the new value to the first value of the stack. Point the original node to the new value.