Question: Suppose a programming language PL m that supports multi-dimensional arrays. Your program written in PL m contains a two-dimensional array, say A[100,50] (100 rows x

Suppose a programming language PLm that supports multi-dimensional arrays. Your program written in PLm contains a two-dimensional array, say A[100,50] (100 rows x 50 columns). You learned that (a) each element of the array requires 2 bytes of memory, and (b) A[0,0] and A[10,1] are stored at memory addresses 1000 and 2002, respectively, on a byte-addressable machine.

Does PLm use row-major order or column-major order? Justify your answer by stating the reason.

Write a formula that, given valid indexes and j, gives the memory address where A[i,j] is stored.

Calculate the memory address of A[10,10].

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!