Enter your book access code

The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).

Don’t have the book yet? The landing page stays open — purchase unlocks this gym.

intermediate · order 68

Hit the doubly-linked wall

list-dll-01Related book chapters: 18 (optional — this page is complete on its own)linked-listwall

Slug: list-dll-01 · Paired reading: Chapter 18

Prompt

A classic prev/next Box doubly linked list cannot assign unique owners (cycles). Implement the idiomatic escape: an index-based doubly linked list over a Vec of slots.

IndexDll stores nodes with prev/next: Option<usize>, plus head / tail. Support push_back(value) -> usize (returns node index) and to_vec() walking head→tail.