Playground

Linked List Viewer

Explore nodes and sequential memory structures conceptually through interactive insertions and deletions.

Linked List

A linear data structure containing a sequence of objects called nodes. Each node stores data and a directional pointer referencing the next node in the sequence. Visualized here are inserts and deletes at any index, showing traversal O(N) logic.

class Node {
data: any;
next: Node | null;
}
Idx
HEAD(Start)
NULL

INSERT

newNode = Node(value)
If list is empty:
HEAD = newNode
If index == 0:
newNode.next = HEAD, HEAD = newNode
Else:
curr = HEAD
Traverse to index - 1
newNode.next = curr.next
curr.next = newNode
Return success

Console Output

SIZE: 0
>Waiting for operations...