Consider the linear arrays AAA[5:50],BBB[-5:10] and CCC[1:8]Data Structure Consider the linear arrays AAA[5:50], BBB [-5:10] and CCC[1:8]. (a) Find the number of elements in each array (b) Suppose Base(AAA) = 300 and w=4 words per memory cell for AAA. Find the address of AAA[35] ,AAA[15], and AAA[55] (a) Length = Upper Bound – Lower Bound +1Length(AAA) = 50-5+1 = 46Length(BBB) = 10-(-5)+1 = 16Length(CCC) = 18-1+1 = 18 (b) Using the formula: LOC(AAA[k]) = Base(AAA)+w(K-LB)LOC(AAA[15] )= 300+4(15-5) = 340LOC(AAA[35] )= 300+4(35-5) = 420AAA[55] is not an element of AAA since 55 exceeds UB = 50. Share on Share to help others Share to help others