taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

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.

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 12…n12\ldots n. Exercises 1 to 5 treat the stack: the test for a legal move sequence, the Catalan count, and the forbidden pattern 312312. 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.

ExerciseRatingKindSolutionLean
2.2.1-600K3writtennot stated yet
2.2.1-106K2writtennot stated yet
2.2.1-215K2writtennot stated yet
2.2.1-9M20K1writtennot stated yet
2.2.1-822K2writtennot stated yet
2.2.1-325K1writtennot stated yet
2.2.1-725K3writtennot stated yet
2.2.1-10M25K1writtennot stated yet
2.2.1-1426K5writtennot stated yet
2.2.1-5M28K1writtennot stated yet
2.2.1-4M34K3writtennot stated yet
2.2.1-12HM34K4writtennot stated yet
2.2.1-11M40K3writtennot stated yet
2.2.1-13M48K9writtennot stated yet

Something is wrong? Report it.