Concept explainers
(Asterisked problems are associated with optional sections.)
3. Rework Problem 2 assuming column major order rather than row major order 2 Suppose an array with six rows and eight columns is stored in row major order starting at address 20 (base ten). 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? What it each entry requires two memory cells?
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Additional Engineering Textbook Solutions
C Programming Language
Introduction To Programming Using Visual Basic (11th Edition)
Concepts of Programming Languages (11th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Starting Out with Java: Early Objects (6th Edition)
- Sub: Data structure Suppose a multidimensional array is declared as A [1...8, - 5...5, -10...5]. If base address of A is 400 and there are 4 words per memory location, then the address of A[3, 3, 3] by using ww column major order isarrow_forwardAn array Arr[50][100] is stored in the memory along the row with each element occupying 2 bytes of memory. Find out the base address of the location Arr[20][50], if the location of Arr[10][25] is stored at the address 10000.arrow_forwardAn array Array[20][15] is stored in the memory along the column with each element occupying 8 bytes of memory. Find out the Base address and address of the element Array [2][3], if the element Array [10][25] is stored at the address 1000.arrow_forward
- Computer Science A two-dimensional array of type int is defined in C using the same structure as a two-dimensional array in Java. If the dimensions are defined as 20 rows by 10 columns, what is the largest contiguous block of memory required by this array? Assume that the machine in question has an address size of 64-bits.arrow_forwardA JPJ department wants to maintain a database of up to 1800 license-plate numbers of people who receive frequent tickets so that it can be determined very quickly whether or not a given license plate is in the database. Speed of response is very important; efficient use of memory is also important, but not as important as speed of response. Which of the following data structures would be most appropriate for this task? A) a sorted linked list B) sorted array with 1800 entries hash table using open addressing with 1800 entries O D) a hash table using open addressing with 3600 entriesarrow_forwardAn array T[-1.35][-2.15] is stored in the memory along the row with each element occupying 4 bytes. Find out the base address and address of element T[2O][5], if an element T[2][2] is stored at the memory location 300O. Find the total number of elements stored in T and number of bytes allocated to T.arrow_forward
- in c++ In a 2D integer array TD, assume that the row indices range from -3 to 7 and column indices range from 6 to 14. An element TD [-3, 6] stored at address 3220. Find out the dimension of TD and address of an element TD [2, 10], if TD stores the elements in column major order.arrow_forwardQuicksort SPLIT (the 2-pointer algorithm covered in class) is applied to the integer array [4,3,5,7,9,2,1], using the first entry as the pivot. Show the series of item swaps that are performed in the split process, and the array after each of these swaps, up to and including the step of placing the pivot at its correct location. You only need to show the split of the original array, you are not required to continue working on the subarrays after the split.arrow_forwardThe benefits of arrays may be summarised as follows: When it comes to arrays, the maximum number of dimensions is What is the difference between a structure and a simple value? An example of a complex data structure would be helpful.arrow_forward
- Question 1 Assume that arrX array is already defined and allocated in memory, its base address 0xabcd3000 and already stored in $a2 and its number of elements in $a3. Answer each of the next questions as required. arrX: .word 0x99,0x20,0x73,0x40,0x50,0x69, ... Please write question numbers and answer parts in this question in order. Q1) The fourth element of arrX is located at HEX address ___________ Q2) Write one MIPS instruction to copy into $t9 the value of the fourth element of arrX: ___________ Q3) Write one MIPS instruction to calculate $t0 = 32 * fourth element: __________ Q4) Write NO more than 3 MIPS instructions to decrement the fourth element of arrX: __________ Q5) Write no more than 6 instructions to calculate $v0= first element - last element in arrX.arrow_forwardQUESTION#1 – LINEAR ARRAYS - Part (a) [ If the starting memory address of an array A[-5, 23] is 450 then what will be the memory address of 21st element? Size of each memory location is 4-byte. Note: In this question array index starts from -5 and end with 23 Part (b) I Suppose you have two different email IDS like abc@yahoo.com and abc@gmail.com. You receive some emails only in gmail, or only in yaho0 but some time you receive an email at both emails account. Suppose your emails subjects are maintaining in linear array data structure such that gmail array has m emails and yahoo has n emails. (In ideal case the subjects are not repeated in any email ID) gmail email subjects Intervie How Exam Best Dangero s for you Hi w call are u week friend yahoo email subjects Feeling Going Good Going Best Hi bad picnic morning abroad Friend Your task is to write an algorithm to collect the emails by UNION method of both emails in a single array named YGmail with size m+n.arrow_forwardOZ-OC-0OV-0 Question 7 A computer program has 50 instructions. The clock rate of this computer is 10 GHz. What is the CPU time of running program given that CPI is 2? O 250 ps O 25 ps O 10 ps O1 micro second O 25 micro second Question 8 Assuming the base address of the array is stored in X22, the following instructions places into X9. LDUR X9, [X22 +8]arrow_forward
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning