#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
#columns:Front	Back	Tags
TAOCP §2.2.5 Doubly Linked Lists: what does it cover?	Lists with links in both directions, making deletion and insertion anywhere cheap. Knuth illustrates them with a detailed discrete-event simulation of an elevator system.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::about
TAOCP §2.2.5: why does it matter?	Doubly linked lists underpin LRU caches and editor buffers, and the elevator simulation is a crash course in discrete-event simulation, a technique still used for modeling systems.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::why
TAOCP §2.2.5, a common trap: “Updating only one of the two links on insert or delete.” What's the catch?	Write the four pointer updates down before coding them.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::trap
TAOCP §2.2.5, exercise 1 (rated 21): what is it asking?	Spell out insertion and deletion at the left end of a doubly linked list.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise
TAOCP §2.2.5, exercise 2 (rated 22, recommended): what is it asking?	Explain why a singly linked list cannot be an efficient general deque.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise
TAOCP §2.2.5, exercise 3 (rated 22, recommended): what is it asking?	Design a button-pressing experiment that proves the elevator really keeps three separate call flags per floor.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise
TAOCP §2.2.5, exercise 5 (rated 20): what is it asking?	Trace how one change to the arrival table changes the elevator's moves.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise
TAOCP §2.2.5, exercise 8 (rated 21): what is it asking?	Write the elevator step the text left out, in MIX.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise
TAOCP §2.2.5, exercise 11 (rated 21, recommended): what is it asking?	Simulate simultaneous updates of many variables cheaply when only a few change per step.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise
TAOCP §2.2.5, exercise 12 (rated 22, recommended): what is it asking?	Explain why the simulation uses doubly linked lists.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise
TAOCP §2.2.5: how many exercises, and how are they rated?	12 exercises, rated 20 to 40.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercises
TAOCP §2.2.5: what should you be comfortable with first?	<ul><li>2.2.4 Circular Lists</li><li>1.4.2 Coroutines</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::prereqs
TAOCP §2.2.5: how should you work through it?	Implement a doubly linked list with a header node and test insert and delete at all positions. The elevator simulation is long: read it for structure, focus on how the event list works, and do not try to trace every MIX line.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::approach
