Skip to Main Content
Introducing Data Structures with Java
book

Introducing Data Structures with Java

by David Cousins
March 2013
Intermediate to advanced content levelIntermediate to advanced
416 pages
9h 41m
English
Pearson Education India
Content preview from Introducing Data Structures with Java

5

Array Data Structures

Array Data Structures Arrays

Contents

  • Arrays as simple structures
  • Some examples and uses
  • Creating arrays dynamically at runtime
5.1 INTRODUCTION

In Chapter 2, we discussed issues that arise if a list of items is represented using separate discrete variables. In this chapter, we see how arrays deal with these issues. We show how items are stored and manipulated as an array, and build a simple example application.

5.2 WHAT IS AN ARRAY?

Consider the eight integers that we touched on in Chapter 2, Section 2.4. It is not efficient to declare eight separate variables with discrete identifiers; instead, make the following declaration:

  int numbers[] ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Structures and Algorithms Using Java

Data Structures and Algorithms Using Java

William McAllister

Publisher Resources

ISBN: 9788131758649