2. Arrays

The array is the most commonly used data storage structure; it’s built into most programming languages. Because arrays are so well known, they offer a convenient jumping-off place for introducing data structures and for seeing how object-oriented programming and data structures relate to one another. In this chapter we’ll introduce arrays in Java and demonstrate a home-made array class.

We’ll also examine a special kind of array, the ordered array, in which the data is stored in ascending (or descending) key order. This ...

Get Data Structures and Algorithms in Java, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.