Doubly linked list

Insert a number between two neighbours, then remove it. Follow the two arrows of each node.

The next link leads forward and prev leads back. A link at an outer end is empty.

Each node keeps its ID when another node is inserted before it. Its position index then changes.

Finding a position by index takes O(n). Rewiring known neighbours takes O(1).