An array is a data structure that stores a group of elements of the same type in contiguous memory locations that can be individually accessed via indices. A two-dimensional array stores rows and columns of data, where each element is accessed by its row and column number. Arrays are easier to use than individual variables because they allow accessing multiple related values using indices, rather than needing separate variables for each value.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
17 views
Asgment 3
An array is a data structure that stores a group of elements of the same type in contiguous memory locations that can be individually accessed via indices. A two-dimensional array stores rows and columns of data, where each element is accessed by its row and column number. Arrays are easier to use than individual variables because they allow accessing multiple related values using indices, rather than needing separate variables for each value.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2
1. What is an array?
In computer science an array[1] is a data structure consisting of a group
of elements that are accessed by indexing. In most programming languages each element has the same data type and the array occupies a contiguous area of storage.
2. Wahat is a 2 demensional array?
• A two-dimensional array is an array in with both rows and
columns. In contrast, gave one dimensional array is simply a linear sequence of elements. • When we define or use a two-dimensional array, we must supply both the row and column numbers. Two-dimensional arrays are good for modeling flat surfaces, for example, the screen of a computer, the layout of a warehouse, or a map. Capital flat surface has two dimensions, and so a two- dimensional array can easily model it. • Java has the ability to define and use arrays with dimensions higher than 2. For example, you can define an array with three dimensions to model physical space, or for dimensions to model physical space with a time dimension. Higher dimensional arrays are common in some applications, such as engineering and physics. However, most applications that use arrays only need one or two-dimensional arrays.
3. why are arrays easier to use than a bunch of related variables?