answersLogoWhite

0


Best Answer

You've pretty much answered your own question because a two-dimensional array is a matrix. Indeed, all multi-dimensional arrays are matrices.

When we create a matrix, we generally know what type of data will be stored in the matrix, how many dimensions it will have and how many elements each dimension will have, thus an array is the ideal container to represent a matrix. It provides the most compact method of storing homogeneous data, provides efficient constant-time random access to the data and introduces the least amount of abstraction into the representation.

Most languages do not provide a built-in matrix type, however this is simply because there is no one matrix type that would suit every possible application. However, all languages do provide a built-in array mechanism which can be used as the basis for any matrix type which is both simple to create and easy to maintain.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How matrices can be represented using two dimensional array?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What are the benefits of multidimensional arrays?

Multi-dimensional arrays are accessed using more than one index: one for each dimension. Multidimensional indexing can be reduced internally to linear indexing; for example, a two-dimensional array with 6 rows and 5 columns is typically represented by a one-dimensional array of 30 elements.


Pointer to 3 dimensons array?

If the array is static you can simply point at the first element. For dynamic arrays you can allocate a contiguous block to a single pointer which can then be subdivided using a one-dimensional array of pointer to pointers, each of which points to a one-dimensional array of pointers, each of which points to a separate object within the array. For extremely large arrays, however, it is better to split the elements into separate one-dimensional arrays, by creating a one-dimensional array of pointer to pointers first, then allocating each of those pointers to a separate one-dimensional array of pointers, each of which points to a separate one-dimensional array of objects. Either way, you must destroy all the individual arrays in the reverse order of creation.


What type of data deals with descriptions?

Descriptions are best represented using a character array (string) data type.


How many types of sorting array in C programming?

You can sort an array with any method you want, but there is a built-in qsort function, declared in stdlib.h (see the attached link).bubble sort, quick sort, insertion sort, merge sort, radix sort and lot more..merge sort is the most efficient one..


What is Array in Programming C?

Arrays allow similar types of data to be stored within a contiguous block of memory such that every data element is accessible in constant time, regardless of its physical location within the array. This is achieved through simple pointer arithmetic treating each element as a memory offset from the start of the array. Since every element is the same length (in bytes), locating any element is simply a matter of calculating its offset from its index. Indices are zero-based thus the third element can be found at index 2. The memory offset for that element is therefore the product of the element size and 2. However, C permits indices to be specified directly, while the pointer arithmetic is done in the background. Thus array_name[2] automatically returns a reference to the third element. Arrays with large and complex variable length data elements need to store those elements separately from the array, usually non-contiguously. This is achieved by using a pointer array. Pointer arrays are particularly useful when sorting extremely large data lists as it is much easier and more efficient to implement a sorting algorithm with an array than it is with a linked list, particularly when constant-time random-access is essential to the algorithm. The time and effort in building the array is generally more than compensated for by the efficiency of the algorithm. Arrays can also be divided and subdivided to better model the data they represent. For instance, a chessboard might be implemented as a one-dimensional array of 64 elements, however it makes more sense to model the chessboard in a two-dimensional array of 8x8 elements. Although the array is still allocated contiguously and can be thought of as being 8 rows and 8 columns, it's actually better to think of this two-dimensional array as being a one-dimensional array of 8 elements, where each element is another one-dimensional array of 8 elements. By thinking this way it makes it possible to allocate extremely large arrays in non-contiguous memory (as completely separate one-dimensional arrays) and also makes comprehension of a four-dimensional array in a three-dimensional world that much easier (unless you actually want to model time and space of course). A four-dimensional array can be thought of in a variety of ways: as being a one dimensional array of three-dimensional arrays, or as a two-dimensional array of two-dimensional arrays, or as a three-dimensional array of one-dimensional arrays, or even as a one-dimensional array of one-dimensional arrays of one-dimensional arrays of one-dimensional arrays. Whichever method you use to imagine your array is immaterial, so long as it makes sense to you that's all that really matters.

Related questions

How do you develop a JAVA program that computes matrices?

Matrices can't be "computed" as such; only operations like multiplication, transpose, addition, subtraction, etc., can be done. What can be computed are determinants. If you want to write a program that does operations such as these on matrices, I suggest using a two-dimensional array to store the values in the matrices, and use for-loops to iterate through the values.


How do you add two matrices using Linux shell script?

write ashell script to add awo matrix using array.


How can you differentiate a lower level array from the higher level array?

Lower level array: 1. Lower level array could be a single dimensional array . 2. It is easy to work with the lower level array . 3. By using lower level array , works get easier. 4. if user try for dry run , he/she can do it without any complication. Higher level array: 1. Higher level array could be a double dimensional array , three dimensional array or nth dimensional array. 2. It's quite complicated to work with higher dimensional arrays. 3. By using higher level array , works get much more easier as compared to lower level array. 4. if user try for dry run , he/she may/maynot do it because there is lot of complications in it.


Application of matrices?

Matrices are used in most scientific fields. They are usually used to represent and manipulate a number of measures simultaneously.For example, they are used to represent and solve systems of simultaneous equations. In basic mechanics could represent the coordinates of the location of particles or specific locations on a rigid body. Joint probability distributions - for n variables - are represented, using matrices, as surfaces in n+1 dimensional space.


Give the syntax to declare two dimensional array using array of pointers?

It is not possible to declare a two-dimensional array using an array of pointers in any programming language, but many programming languages support declarations of N-dimensional arrays of pointers.The exact syntax varies with the programming language, and requires support for N-dimensional arrays and pointers. In C, the following declares an array of pointer variables, each implemented as pointer to the generic type "void":void* array_1D[10];The type of the expression array_1D is "void * const."The following example expands on the previous one by declaring a two-dimensional array of "void" pointers:void* array_2D[10][20];The type of the expression array_2D is "void ** const."The last example declares a 3-dimensional array of "void" pointers, which can be seen as a 2-dimensional array of arrays of pointers:void* array_3D[10][20][30];


What are the benefits of multidimensional arrays?

Multi-dimensional arrays are accessed using more than one index: one for each dimension. Multidimensional indexing can be reduced internally to linear indexing; for example, a two-dimensional array with 6 rows and 5 columns is typically represented by a one-dimensional array of 30 elements.


Pointer to 3 dimensons array?

If the array is static you can simply point at the first element. For dynamic arrays you can allocate a contiguous block to a single pointer which can then be subdivided using a one-dimensional array of pointer to pointers, each of which points to a one-dimensional array of pointers, each of which points to a separate object within the array. For extremely large arrays, however, it is better to split the elements into separate one-dimensional arrays, by creating a one-dimensional array of pointer to pointers first, then allocating each of those pointers to a separate one-dimensional array of pointers, each of which points to a separate one-dimensional array of objects. Either way, you must destroy all the individual arrays in the reverse order of creation.


Can ragged arrays created by using java?

I assume you mean that you have a number of rows, and that not all rows have the same number of "cells". Yes, in Java a two-dimensional array is implemented as an array of arrays (each item in the top-level array is, in itself, an array); a 3-dimensional array is an array of arrays of arrays, etc.; and there is no rule stating that all secondary (etc.) arrays must have the same number of elements.


What type of data deals with descriptions?

Descriptions are best represented using a character array (string) data type.


How can you use a sentence using matrices?

Which one of those matrices is more comfortable to sleep on?


How many types of sorting array in C programming?

You can sort an array with any method you want, but there is a built-in qsort function, declared in stdlib.h (see the attached link).bubble sort, quick sort, insertion sort, merge sort, radix sort and lot more..merge sort is the most efficient one..


What is the two-dimensional figure?

A two-dimensional figure is one that can be represented using two variables (usually x and y). In more common terms, it is called 'flat'.