a) Consider the array int a [ 10 ] [ 10 ] and the base address 2000, then calculate the address of the array a [ 2 ] [ 3 ] in the row and column major ordering.
b) Write the advantage of circular queue over linear queue.
Ans. a) Formula of Row major order is
Loc(A[j,k])= Base Address + w[n(j-1) + (k-1)] where w is memory cell.
Loc(A[2,3]= 2000 + 2[10(2-1) +(3-1)]
= 2000+ 24
= 2024 ans.
Formula of Coloumn major order is
Loc(A[j,k])= Base Address + w[m(k-1) + (j-1)] where w is memory cell.
Loc(A[2,3]= 2000 + 2[10(3-1) +(2-1)]
= 2000 + 42
= 2042 ans.
Ans.
b) In Circular Queue we utilize memory efficiently. because in queue when we delete any element only front increment by 1, but that position is not used later. so when we perform more add and delete operation, memory wastage increase. But in Circular Queue memory is utilized, if we delete any element that position is used later, because it is circular.
a) Sort the following list using the Radix Sort :
189, 205, 986, 421, 97, 192, 535, 839, 562, 674
"Write an algorithm to test whether a given binary tree is a binary search tree."
Discuss Quality Assurances
Write the recursive algorithm to find x^ n.
Write a C program to convert any number into word.
Write a C program to find sum of digit of any no.
What are the methodology for dialog design?
Write an program to generate Pascal’s triangle.