next up previous
Next: Inserting a new element Up: Unit 12 Previous: Creation and linking of

Operations on linked lists

Suppose that we have already created a linked list in memory, and that a variable lis of type ListNode contains a reference to the first element of the list.

We can perform various operations on such a list. The most common operations are:

Note that some of the operations above do not modify the list at all, some modify only the information field of a node, and some modify the structure of the list, by changing how the nodes are connected to each other. We will realize each operation through a static method:


next up previous
Next: Inserting a new element Up: Unit 12 Previous: Creation and linking of