
Get Them All. Algorithms and Permutations. 343
6. Find a sufficient and necessary condition for a permutation to be gd-
obtainable.
7. Recall the definition of sorting by t stacks in series from Exercise 30.
Let t = 2. Characterize the set of permutations that are sortable by
this procedure. We will call these permutations two-series-sortable.
8. Find a formula for the number of permutations of length n that are
two-series-sortable.
9. Modify the sorting procedure of Exercise 11 by making it undetermin-
istic as follows. In any given step, we can either
(a) put the next element of the input into any stack S
i
, for any i ∈ [t],
or
(b) put the entire conten