TAOCP 2.2.5: Doubly Linked Lists
Section 2.2.5 exercises: 12/12 solved.
Section 2.2.5. Doubly Linked Lists
Exercises from TAOCP Volume 1 Section 2.2.5: 12/12 solved.
| # | Rating | Category | Status | Time |
|---|---|---|---|---|
| 1 | [21] | medium | solved | 39s |
| 2 | [22] | medium | solved | 46s |
| 3 | [22] | medium | solved | 32s |
| 4 | [24] | medium | solved | 28s |
| 5 | [20] | medium | solved | 39s |
| 6 | [23] | medium | solved | 43s |
| 7 | [25] | medium | solved | 40s |
| 8 | [21] | medium | solved | 30s |
| 9 | [23] | medium | solved | 39s |
| 10 | [40] | project | solved | 34s |
| 11 | [21] | medium | solved | 30s |
| 12 | [22] | medium | solved | 1m08s |
TAOCP 2.2.5 Exercise 1
In representation (1) of a doubly linked list, there are distinguished variables `LEFT` and `RIGHT` giving the locations of the leftmost and rightmost nodes, respectively.
TAOCP 2.2.5 Exercise 2
Let a _general deque_ be a data structure that allows insertion and deletion at both ends.
TAOCP 2.2.5 Exercise 3
To demonstrate that the elevator system requires three independent binary variables per floor, we must exhibit sequences of button presses that show each variable can be set or cleared independently o...
TAOCP 2.2.5 Exercise 4
Activity `E9` in the elevator coroutine is a scheduled action that occurs after the completion of certain steps in the elevator's operation, specifically following step `E6` (door-closing and possible...
TAOCP 2.2.5 Exercise 5
The scenario given concerns the discrete simulation of the Caltech Mathematics building elevator, using the routines described in Section 2.
TAOCP 2.2.5 Exercise 6
The desired change is that a user waiting on floor `IN` should enter the elevator only if the elevator is accepting passengers whose desired direction agrees with the user's destination.
TAOCP 2.2.5 Exercise 7
The statement `JANZ CYCLE` at line 154 was intended to skip the "give up" activity `U4` for a user if the elevator had already arrived at the user's floor.
TAOCP 2.2.5 Exercise 8
Step `E8` is the action that occurs after the elevator has moved one floor in its current direction.
TAOCP 2.2.5 Exercise 9
The `DECISION` subroutine is called whenever the elevator is in a dormant condition and a new request may require a change of state.
TAOCP 2.2.5 Exercise 10
Let the building under consideration have $F$ floors, numbered $0,1,\dots,F-1$, and a single elevator with automatic controls.
TAOCP 2.2.5 Exercise 11
Let $V[1], \dots, V[n]$ be the variables of the system, and let a step of the simulation specify a small subset of these variables to be updated simultaneously.
TAOCP 2.2.5 Exercise 12
In the elevator simulation, the program must frequently insert and delete users from various lists representing queues on floors (`QUEUE[IN]`) and passengers inside the elevator (`ELEVATOR`).