Question: Chapter 2 Array - Based Structures 3 . Give the mapping function used to calculate the address of the k th element of a one
Chapter ArrayBased Structures
Give the mapping function used to calculate the address of the k th element of a onedimensional array of integers, assuming element zero is stored at location the array is stored in ascending memory locations, and that an integer occupies bytes of memory.
integers are stored in a twodimensional array of four rows and five columns. The name of the array is ages.
a Draw a picture of the rows and columns of the array, indicating the column numbers across the top of the array and the row numbers along the left side.
b Place an x in the cell of your picture whose contents is modified by the statement: ages;
c Give the memory location of the cell ages assuming the array is stored in row major order in ascending memory locations beginning at location Assume each cell is bytes.
A data structure is to be chosen that will allow the customers to look up the price of an item, given its item number. The data set will only be loaded once and never modified. Of the three arraybased structures discussed in this chapter, which would be best suited for this application?
The Sorted Array structure accesses nodes using the Binary Search algorithm, and the UnsortedOptimized Array structure uses a Sequential Search to access nodes. Knowing that a binary search is significantly faster than a sequential search, explain why it is that the average speed of the UnsortedOptimized array structure is faster than that of the Sorted Array structure. Assume all four basic operations are equally probable.
The UnsortedOptimized array structure is used to store a data set. Calculate its density if:
a Each of the client's nodes contains bytes of information and there are nodes in the data set.
b Each of the client's nodes contains bytes of information and there are nodes in the data set
You have coded an application for your friend's business that uses an UnsortedOptimized array to store the venture's data. One day your friend informs you that the speed of the operations performed on the data set seems to be getting faster and faster. Explain how this could happen
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
