WizIQ helps you learn and teach online - any subject you can think of!
Join for FREE

Elements in Double Dimension Array

Add to Favourites
Post to:

Double Dimension Array In a double dimension array elements are arranged in rows and columns and we need two subscripts, one each for row and column. Elements can be stored into a double dimension array in two ways : Row major wise and 2) Column major wise . Row Major Wise In Row major ,elements are stored row wise i.e. First row all the columns, then the second row all the columns, then the third row all the columns … and so on. Elements into a double dimension array ‘A’ of 4 rows and 3 columns in row major wise are as follows : A[0][0] 1 A[0]01] 2 A[0][2] 3 A[0][3] 4 A[1][0] 5 A[1][1] 6 A[1][2] 7 A[1][3] 8 A[2][0] 9 A[2][1] 10 A[2][2] 11 A[2][3] 12 1st element in A[0][0], 2nd element in A[0][1] and 3rd element in A[0][2] 4th element in A[1][0], 5th element in A[1][1] and 6th element in A[1][2]. 7th element in A[2][0], 8th element in A[2][1] and 9th in A[2][2]. 10th element in A[3][0], 11th element in A[3][1] and the 12th element A[3][2]. How the numbers 1 to 12 are stored into the array A[4][3] is shown below : Column Major Wise : In column major wise elements are stored column wise i.e. first column all the rows then 2nd column all the rows, the 3rd column all the rows …. And so on. In column major wise elements into a double dimension array A[4][3] will be stored as follows : 1st element in A[0][0], 2nd element in A[1][0], 3rd in A[2][0], 4th in A[3][0] 5 th in element in A[0][1], 6 th element in A[1][1], 7 th in A[[2][1], 8 th in A[3][1] 9 th element in A[0][2], 10 th element in A[1][2],11 th in A[2][2],12 th in A[3][2] How the numbers 1 to 12 will be stored in to the array A[4][3] is shown below : A[0][0] 1 A[0][1] 5 A[0][2] 9 A[1][0] 2 A[1][1] 6 A[1][2] 10 A[2][0] 3 A[2][1] 7 A[2][2] 11 A[3][0] 4 A[3][1] 8 A[3][3] 12

Description
How Data are Stored and Accessed into and from a Double Dimension Array

Comments

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no.:


Area code Number
Subject you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
5 Members Recommend
45 Followers

Your Facebook Friends on WizIQ