AlgoScope

Circular Linked List

The last node links back to the first. Traversal wraps around.

Data structures, data structure, intermediate
Step 4: at 5.5142currhead
Step 4: at 5.5142currhead

Singly Linked List: Close the list into a ring and walk it

Decision, step 6 of 9

Step 4 of 6: from 2 follow next to 5. That is the tail's arrow, so the walk wraps round to the head instead of stopping.

How singly linked list works

Cost

Access
O(n)
Insert at head
O(1)
Insert at tail
O(1) with tail pointer
Space
O(n)

Taught by the same lesson

Singly Linked List covers these too, in the same run.