Question
2. Develop a formula, as in our discussion, to access an array element if the 2 - dimensional array is stored in column - major
2. Develop a formula, as in our discussion, to access an array element if the 2
-
dimensional array
is stored in column
-
major order, i.e., array elements are stored in memory column
-
by
-
column
rather than row
-
by
-
row.
Number of columns we skip to get to the correct column in which our element is to be found:
Number of rows in each column:
Number of bytes each column occupy in memory:
Number of bytes we skip in memory to get to the first memory location of the column in
which our element is to be found?
Starting location in memory for the column in which our element is to be found:
Number of elements we skip in the correct column to get to the element whose memory
location were tying to locate?
How many bytes do these elements occupy in memory?
What is the memory location our element be found at?
Simplifying the expression produces the following mapping function:
I need help and answers for the questions above.
apping Functions 1. Assume each element of an array list, stored in row-major order, occupies four bytes of storage. If array list is declared by each of the following, and the base address of the array is 100, find the address of the indicated array element. Please show all work Declaration integer 1ist(1..100] integer 1ist [0..1O, 0..201: 11st 15, 10 integer 1istf-5..5, -1..12): 11st(3, 81 Address list[101 2. Develop a formula, as in our class discussion, to access an array element if the two-dimensional array is stored in column-major order, i.e., array elements are stored in memory column-by-column rather than row-by-row. Please show all work 1. How many rows do we skip to get to the correct row in which our element is to be found? 2. How many array elements are in each row? 3. How many bytes does each row occupy in memory? 4. How many bytes do we skip in memory to get to the first memory location of the row in which our element is to be found? 5. What is the starting location in memory for the row in which our element is to be found? 6. How many elements do we skip in the correct row to get to the element whose memory location we're trying to locate? 7. How many bytes do these elements occupy in memory? 8. What is the memory location our element will be found atStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started