Saturday, October 22, 2011

Linked Lists 4: The Empty List (null)


number of data values number of nodes
3 3
2 2
1 1
0 0
null signifies "the empty list"

A recursive definition of a linked list:
* null
* a node whose next refers to a linked list

Why Linked Lists?
* Linked list are BEAUTIFUL.
* Linked lists are more efficient than arrays/ArrayLists in some situations
* Linked lists provide a foundation for understanding other node-based data structures (trees, graphs)

No comments:

Post a Comment