Skip to main content

3 docs tagged with "linked-list"

View all tags

Intersection of Two Chains

Two paths that merge share a tail. Find the first shared node with a set, or with two pointers that swap starts.

Lowest Common Ancestor

One question - where do the paths to two nodes split - answered with steadily less information about the tree.

Rebuilding a Number

Two lines of arithmetic - peel the last digit off, append a digit on - and a choice of base. Every problem here is those two lines wearing different clothes.