All lessons

Linked Lists

8 min · Python examples

Chain nodes with next pointers — traverse, count, and update without shifting a whole array.

Techniques · Linked Lists0/5 cleared

Enemy 1 of 5

A singly linked list stores values in nodes. Each node holds a value and a next pointer to the following node.

Traverse by walking from head with a while loop: cur = cur.next until cur is None. Inserting at the front is O(1); finding by index is O(n).

You
Binary Treant

Loading editor...

Ln 1, Col 1Spaces: 4
Sign up to fightTarget output: 3