Data Structures, Algorithms, & Applications in C++
Chapter 9, Exercise 5
- (a)
-
The extensions are
- input( ):
-
Input a queue from front to rear;
- toString( ):
-
Return the queue elements, as a string, from front to rear;
- split(a, b):
-
Split a queue into the queues a and b.
The elements are distributed alternately to
a and
b, beginning with
a.
- combine(a, b):
-
Combine the queues a and b into
a single queue.
The elements in the combined queue are taken alternately from
a and
b, beginning with
a.