O'Reilly logo

A Concise Introduction to Data Structures using Java by Mark J. Johnson

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

Chapter 3

Integer Stacks

We now turn to the study of data structures. A data structure is just a way of storing data, along with a set of operations for manipulating that data. If you have used anything like a list, map, array, or dictionary, then you already have some experience with data structures. Our purpose here is to begin a systematic study of common data structures, focusing on their use, implementation, and performance. More advanced features of Java will also be described as we need them along the way.

We begin with a simple data structure known as a stack.

3.1 Stack Interface

A stack is an abstraction of a vertical stack of physical objects. For example, imagine a tall stack of books. It is hard to pull a book out from the middle ...

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