Question: How to solve using the the equation below . 1,3 Implementation of 2-dimensional arrays using RMO. Given an array B[1..3, 1..3] it is implemented as

How to solve using the the equation below How to solve using the the equation below . 1,3 Implementationof 2-dimensional arrays using RMO. Given an array B[1..3, 1..3] it is

. 1,3 Implementation of 2-dimensional arrays using RMO. Given an array B[1..3, 1..3] it is implemented as follows: Start address of Ba Array B has the following attributes 1,1 Lower bound and Upper bound for the first and the second dimension are designated by LB1, UB1, LB2, UB2 respectively 1,2 offset=4 The length of the row is defined by S= (UB2-LB2 +1) *E We assume the length of the element is E 2,1 Address of B[2,2] The location of B[i,j] is defined by: Lvalue (B[i,j]) = a +offset = Q+ (i - LB1)*S+(j-LB2)*E = VO+i*S+j*E 2,3 Where VO is the address of the zeroth element VO Q -(LB1*S+LB2*E) 3,1 Example: Compute the address of B[2,2]. We assume E=1, then S=(3-1+1)*1=3 3,2 Lvalue(B[2,2])=a + (2-1)* 3+(2-1)*1 =2+3=Q+ 3+1=Q+4 2,2 3,3 consider the following declaration of a four dimensional array Type A = array [L.2, 2.4, 13, 12] of integer Var B:A Assuming the storage representation of B is row major order and the length of storage representation of integer (e) is 1 The Lvalue( B(1,2,3,1]) is Select one: A. Starting address of B +4 B. Starting address of B +2 C. Starting address of B + 12 D. Starting address of B+ 6 Clear my choice

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!