Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#1. Suppose a homogeneous array with 6 rows and 8 columns is stored in row major

ID: 3627188 • Letter: #

Question

#1. Suppose a homogeneous array with 6 rows and 8 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 if each entry requires two memory cells?
#2. What complications are imposed if one tries to implement a dynamic list using a traditional homogeneous array?
#3. Describe a method for storing three-dimensional homogeneous arrays. What addressing formula would be used to locate the entry in the ith plane, jth row, and the kth column?
#4. Does a queue crawl through memory in the direction of its head or its tail? Explain your answer.

part2 :


#1. What is the difference between coupling and cohesion? Which should be minimized and which should be maximized?

Explanation / Answer

1)39th location is the address if it takes one memory cell

   59th location is the address if it takes two menory locations.

2) When we are working with dynamic memory location, we are very careful about allocating memory and deallocating it. And need to use pointers to point at different locations. That adds complexity in the programming in dynamic list.

3) If you want to declare three dimensional array, we can declare it as int a[10][12][13]. This array contains 10 planes ans each plane contains 12 rows and 13 columns. we can address the location of particular element with a[i][j][k]. ith plane and jth row and kth column

4) Queue is nothing but First in First out process. So it will crawl through head only. Because the first inserted element is available at first location only.

section 2:

1)Cohesion is nothing but whole the functionality together. Means when you are implementingg some functionality through certain program, that program is capablity to handle every aspect related to it.

Coupling means how extent the written code is depend on other codes or functions. Means If there is any change occurs in other codes, how extent will you change your class.

So A high cohesion and low coupling is required for good programming