Singly-linked lists
Here is a singly linked list (SLL):
Each node contains a value and a link to its successor (the last node has no successor)
The header points to the first node in the list (or contains the null link if the list is empty)
Creating a simple list
To create the list ("one," "two," "three"):
Cell numerals = new Cell(); numerals = new Cell("one", new Cell("two", new Cell("three", null))); |
0 comments:
Post a Comment