All algorithms

Linked List Operations

Append, prepend, delete, and reverse operations on a singly linked list. Reversal flips every next-pointer with three moving references (prev / curr / next).

time push/delete O(n), reverse O(n)
space O(1)

Press Tab out of the box or click Resetto regenerate frames from the current input.

Visualization
No frames yet — edit input and click Run.
Pseudocode
push_head(v): new -> head; head = new
push_tail(v): walk to tail; tail.next = new
delete(v):    walk until .next.value==v; .next = .next.next
reverse():    prev=nil; while cur: nxt=cur.next; cur.next=prev; prev=cur; cur=nxt