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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.