Learn · Volume 1 · in the Volume 1 course
Section 2.2.1. Stacks, queues and deques
14 exercises: 14 with a written solution, 0 stated in Lean, 0 proved in Lean.
1. Read first
The companion chapter builds on these. Read the ones you do not know yet.
- C2.1, in C2. Information structures not written yet
- C1.2.6, in C1. Basic concepts not written yet
2. Read the section
Read Section 2.2.1 in your copy of the book. Then read the companion chapter Stacks, queues and deques (a draft): it explains each item in the words of the handbook, with examples and proofs. The items of the section and their status.
3. Work the exercises
Section 2.2.1
The fourteen exercises of this section study what a stack, a queue and a deque can do to the order of . Exercises 1 to 5 treat the stack: the test for a legal move sequence, the Catalan count, and the forbidden pattern . Exercises 6 to 9 compare the queue and the two restricted deques. Exercises 10 to 12 count the output-restricted deque, with a generating function and its growth. Exercise 13 is an open count for the general deque, and exercise 14 builds a queue from two stacks.
Do exercises 3, 4 and 5 first. Their ideas, the stack height and the first return to the empty stack, come back in exercises 9 to 12.
From the Solutions volume of the handbook. The source.
The list starts with the lowest rating. Try each exercise on paper first. Its page has the hints one at a time, the solution behind a click, and the Lean status.
| Exercise | Rating | Kind | Solution | Lean |
|---|---|---|---|---|
| 2.2.1-6 | 00 | K3 | written | not stated yet |
| 2.2.1-1 | 06 | K2 | written | not stated yet |
| 2.2.1-2 | 15 | K2 | written | not stated yet |
| 2.2.1-9 | M20 | K1 | written | not stated yet |
| 2.2.1-8 | 22 | K2 | written | not stated yet |
| 2.2.1-3 | 25 | K1 | written | not stated yet |
| 2.2.1-7 | 25 | K3 | written | not stated yet |
| 2.2.1-10 | M25 | K1 | written | not stated yet |
| 2.2.1-14 | 26 | K5 | written | not stated yet |
| 2.2.1-5 | M28 | K1 | written | not stated yet |
| 2.2.1-4 | M34 | K3 | written | not stated yet |
| 2.2.1-12 | HM34 | K4 | written | not stated yet |
| 2.2.1-11 | M40 | K3 | written | not stated yet |
| 2.2.1-13 | M48 | K9 | written | not stated yet |
Something is wrong? Report it.