O'Reilly logo

Computer Science: An Interdisciplinary Approach by Kevin Wayne, Robert Sedgewick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.3 Stacks and Queues

In this section, we introduce two closely related data types for manipulating arbitrarily large collections of objects: the stack and the queue. Stacks and queues are special cases of the idea of a collection. We refer to the objects in a collection as items. A collection is characterized by four operations: create the collection, insert an item, remove an item, and test whether the collection is empty.

When we insert an item into a collection, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required