Chapter 3
Fundamental Data Structures
Contents
3.1.1 Storing Game Entries in an Array
3.1.3 java.util Methods for Arrays and Random Numbers
3.1.4 Simple Cryptography with Character Arrays
3.1.5 Two-Dimensional Arrays and Positional Games
3.2.1 Implementing a Singly Linked List Class
3.3.2 Designing and Implementing a Circularly Linked List
3.4.1 Implementing a Doubly Linked List Class
3.5.1 Equivalence Testing with Arrays
3.1 Using Arrays
In this section, we explore a few applications of arrays—the concrete data structures introduced in Section 1.3 that access their entries using integer indices.
3.1.1 Storing Game Entries in an Array
The first application we study is storing a sequence of high score entries for a video game in an array. This is representative of many applications in which a sequence of objects must be stored. We could just as easily have chosen to store records for patients in a hospital or the names of players on a football team. Nevertheless, let us focus on storing high score entries, which is a simple application that is already rich enough to present some important ...
Get Data Structures and Algorithms in Java, 6th 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.