[prev] 70 [next]

Iteration over Linked Lists (cont)

Print all elements:

showLL(L):
|  Input linked list L
|
|  p=L
|  while p≠NULL do
|     print p.value
|     p=p.next
|  end while

Time complexity: O(|L|)