Question

Determine the memory address for the following element using row-major order. Show the math. Given, the...

Determine the memory address for the following element using row-major order. Show the math.

Given, the base address of the array is 1200.

The array is 9 rows, 12 columns.

Element size is 4.

What is the memory address of Array[9,11]?

for data structure class

Homework Answers

Answer #1

Solution:

Given,

=>Base address = 1200

=>Number of rows = 9

=>Number of columns = 12

=>Size of each element = 4 bytes

=>Row-major order is used.

Explanation:

Calculating address of Array[9, 11]:

=>Address of an element Array[i, j] = base address + size of element*(i*number of rows + j*number of columns)

=>Address of Array[9, 11] = 1200 + 4*(9*9 + 11*12)

=>Address of Array[9, 11] = 1200 + 4*(81 + 132)

=>Address of Array[9, 11] = 1200 + 4*(213)

=>Address of Array[9, 11] = 1200 + 852

=>Address of Array[9, 11] = 2052

=>Hence memory address of Array[9, 11] = 2052.

I have explained each and every part with the help of statements attached to it.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1. An array has an index of [5] at the starting address of 200. It has...
1. An array has an index of [5] at the starting address of 200. It has 3 words per memory cell, determine loc[3],loc[4] and NE. (3 Marks: 1 mark for each) 2. A 2-D array defined as A[10 , 5] requires 4 words of storage space for each element. Calculate the address of A[4,3] given the base address as 250 • If the array is stored in Row-major form • If the array is stored in Column-major form 3. Write...
Part 4: Merge Sort Q7. Arrange the following arrays in ascending order using Merge sort. Show...
Part 4: Merge Sort Q7. Arrange the following arrays in ascending order using Merge sort. Show all steps. 7          11        2          9          5          14 Q8. State the number of sub-arrays for each pass. Pass Split # sub-arrays 1st 2nd 3rd Pass Merge # sub-arrays 1st 2nd 3rd Part 5: Quick Sort Q9. Sort the following unordered list using quicksort. Assume that the pivot you use is always the lastelement. Show all steps. 7          11        2          9          5          14 Cross Over => swap pivot with?   Swap with Low (pivot last element)...
Given the following list of functions, determine the order of growth of each using big-Theta notation...
Given the following list of functions, determine the order of growth of each using big-Theta notation and put all the functions in order from slowest-growing to fastest-growing. Be sure to put functions of equal growth rate on the same level. Unless otherwise noted, you can assume all logarithms are base-2. 6nlog(2n)+8n 4n2log(log(8n))+8n2+n 500 n3+7nlog(n2) + 4n 2n+2n+1 log(4n2)+3n+1 12 8log(24n)+10 8n2log(5n2)+7n+200 4log(n3)+1000 100log(16n)log(n6)+23 8nlog(log(n4))+6n+32 9log(log(8n))
1. The memory units that follow are specified by the number of words times the number...
1. The memory units that follow are specified by the number of words times the number of bits per word. How many address lines and input/output data lines are needed in each case? (a) 8K X 16 (b) 2G X 8 (c) 16M X 32 (d) 256K X 64 2. Give the number of bytes stored in each memory unit in question 1. 3. Word number 563 decimal in the memory shown in Fig. 7.3 (see Mano-Ch7.pdf) contains the binary...
1.) Perform the following multiplication using Booth’s algorithm: (You will receive full credit only if you...
1.) Perform the following multiplication using Booth’s algorithm: (You will receive full credit only if you show all your work)      13 x -13 (a) 27/4 Using paper pencil approach and (b) simulate how a machine does this job 2.)Perform the following division as directed: (a) 27/4 using non-restoring division algorithm // we need 4 quotient bits. (b) Using Newton-Raphson algorithm find 1/d when d=0.84 // show the results of the first 3 iterations 3.) A real-time computer system has...
A Guide to SQL Questions 1. How do you create a table using SQL? 2. How...
A Guide to SQL Questions 1. How do you create a table using SQL? 2. How do you delete a table using SQL? 3. What are the common data types used to define columns using SQL? 4. Identify the best data type to use to store the following data in Oracle, in SQL Server, and in Access:    a. The month, day, and year that an employee was hired    b. An employee’s Social Security number    c. The department...
Consider the following set of sample data, and find the following (note: if you are using...
Consider the following set of sample data, and find the following (note: if you are using TI 83 to find these values, you need to write down the formulas that you should have used) 19 12 9 19 0 4 3 14 5 5 24 2 5 7 17 (a). Mean (b). Median (c). Mode (d). Standard Deviation (e). Variance (f). Find the z-score for 14. (i). Construct a Box-whisker plot for the data (j). Construct a frequency distribution Table....
Answer question for C# 1 of 10 When items are added or removed, a list resizes...
Answer question for C# 1 of 10 When items are added or removed, a list resizes itself. True False Question 2 of 10 What happens when you assign one list to another using the assignment operator? An error message generates. Elements copy to new memory locations. Both lists become value-type data elements. Both lists reference the same memory locations. Question 3 of 10 Which of the following is a valid example of calling a method and sending it an array...
In the following C code, Which variable if NOT of primitive data type? A. a B....
In the following C code, Which variable if NOT of primitive data type? A. a B. b C. c D. d int a = 10; double b = 20.0; float c = false; char d[5] = "Hello"; // here we define a string In programming language C, the implementation of a string data type is limited dynamic length, which means the length of a string variable is fixed once it has been defined. A. True B. False In C# programming...
Java question, Please answer everything. Thank you Answer the following questions as briefly (but completely) as...
Java question, Please answer everything. Thank you Answer the following questions as briefly (but completely) as possible: What is a checked exception, and what is an unchecked exception? What is NullPointerException? Which of the following statements (if any) will throw an exception? If no exception is thrown, what is the output? 1: System.out.println( 1 / 0 ); 2: System.out.println( 1.0 / 0 ); Point out the problem in the following code. Does the code throw any exceptions? 1: long value...