Ask Question

Suppose an array with six rows and eight columns is stored in row major order starting at address 20 (base 10). If each entry in the array requires only one memory cell, what is the address of the entry in the third row and fourth column?

+4
Answers (1)
  1. 19 August, 10:39
    0
    39

    Explanation:

    Since each of the address occupies only 1 memory cell and the 2-D array is row-major 2-D array. So the elements will be filled row wise. First the first row will be fully filled after that second row and so on. Since we want the address of the element at third row and fourth column.

    we can generalize this:

    address of the element at ith row and jth column=s + (c * (i - 1) + (j - 1)).

    s=Starting address.

    c=Number of columns in the 2-D array.

    address=20 + (8 * (3-1) + (4-1))

    =20 + (8*2+3)

    =20+16+3

    =39

    Or you can make a matrix of six rows and eight columns and put first cell with 20. Start filling the elements row wise one by one and look what is the count of 3rd row and 4th column.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Suppose an array with six rows and eight columns is stored in row major order starting at address 20 (base 10). If each entry in the array ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers