2
You visited us
2
times! Enjoying our articles?
Unlock Full Access!
Byju's Answer
Other
Other
2D Arrays
A in an array...
Question
A in an array [-5 ... 5, 3 ... 13] of elements. The starting location is 100. Each element occupies 2 memory cells. Calculate the location of an element A(0, 8) using row major order :
Open in App
Solution
RMO location of
A
[
i
,
j
]
=
L
0
+
[
(
i
−
i
l
b
)
∗
r
2
+
(
j
−
j
l
b
)
]
C
A[0, 8]
= 100 + [0 - (-5) * 11 + (8 - 3)] * 2
= 100 + (5 * 11 + 5) * 2
= 100 + 120
= 220
Suggest Corrections
0
Similar questions
Q.
A is an array
[
5
⋯
15
,
−
5
⋯
5
]
of elements.
The starting location is 100.
Each element occupies 4 memory cells.
Calculate the location of an element
A
(
6
,
2
)
using column major order.
Q.
A is an array
[
6
⋯
16
,
−
6
⋯
6
]
of elements.
The starting location is 500.
Each element occupies 4 memory cells.
Calculate the location of an element
A
(
8
,
2
)
using column major order.
Q.
A is an array [2 .....6, 2......8] of elements. The starting location is 110. The location of an element A(5, 4) using row major order is____
Q.
Consider a 2 - D array A[m][n] where m are the number of rows and n are the number of columns. Assuming that each of the element takes 's' memory locations. The array A is stored in a row-major order, then the address of the element A[i][j] can be given as : (Assuming the location of
1
s
t
element as b and starting of the array index from 1)
Q.
Let A be a two-dimensional array declared as follows:
A: array [1...10] [1...15] of integer;
Assuming that each integer takes one memory location. The array is stored in row- major order and the first element of the array is stored at location 100. What is the address of the element A [i][j] ?
View More
Join BYJU'S Learning Program
Grade/Exam
1st Grade
2nd Grade
3rd Grade
4th Grade
5th Grade
6th grade
7th grade
8th Grade
9th Grade
10th Grade
11th Grade
12th Grade
Submit
Related Videos
2D Arrays
OTHER
Watch in App
Explore more
2D Arrays
Other Other
Join BYJU'S Learning Program
Grade/Exam
1st Grade
2nd Grade
3rd Grade
4th Grade
5th Grade
6th grade
7th grade
8th Grade
9th Grade
10th Grade
11th Grade
12th Grade
Submit
Solve
Textbooks
Question Papers
Install app