12-StaticArrays

12-StaticArrays - Chapter XII The Java Static 1D & 2D...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter XII Chapter XII Topics 12.1 Introduction to Data Structures 12.2 Array Definition 12.3 1D Array Declaration and Access 12.4 Assigning Random Array Values 12.5 Accessing Array Elements with <for. .each> 12.6 Introduction to Static 2D Arrays 12.7 Storing Objects in a Static Array 12.8 Storing a Static Array in an Object 12.9 Summary Chapter XII Java Static 1D & 2D Arrays 591
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12.1 Introduction to Data Structures Early in the course you were introduced to simple data types, like int , float , char , double , and boolean . Each of these data types can be used to create a variety of required variables. A simple data type variable is a location in memory that stores a single value that can be used by a computer program. Single values are practical for loop counter variables, maximum number of grades, the height of Pikes Peak and the number of medals won by the United States at the last Olympics. Programs that handle passenger airline reservations, student college transcripts, employee payroll records and hospital patient information, require massive data storage. Such major storage requirements cannot be handled efficiently by thousands of simple data type variables, each storing a single value. You will need more sophisticated data types. It can be argued that you have been storing multiple values inside objects since the very beginning, and that is very true. However, the data stored inside the classes and objects so far have been one or more simple data types. There are many situations where data needs to hold more than one value. Such a situation calls for using a data structure . So what is a data structure? Look at a building. Note that it is made up of smaller structures like rooms, halls, stairways, etc. A room is made up of walls, floors, ceilings, desks, chairs, etc. Another example can be found with animals. Animals are organisms made up of organ systems . Each organ system is made up of organs . Organs are made up of tissues , and tissues are made up of cells . We could continue and work down to the molecular and atomic level, but for this analogy, assume that the cell is the simplest, lowest level. The whole point is that the structure, an organism in this case, is made up of other, smaller structures, until eventually you reach the smallest component. These two examples are used to motivate the definition of a data structure. In computer science it really is the same idea. The only difference in structures is the nature of the smallest building block used to create the structure. In an animal organism it is a cell. In a building it may be a brick or a plank and in a computer science data structure it is a simple data type. First Data Structure Definition
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 36

12-StaticArrays - Chapter XII The Java Static 1D &amp; 2D...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online