Time Left - 15:00 mins

GATE CS 2021 : Data Structure & Programming Quiz 2 (App update required to attempt this test)

Attempt now to get your rank among 1251 students!

Question 1

Consider the following statements on Array : S1 : Array is static in nature whose size needs to be declared first.S2 : Increasing the size of array takes O(n) time.Now choose the correct option :

Question 2

Consider a two-dimensional array with elements stored in the form of lower triangular matrix. How many elements must be crossed to read A[4, 2] from the array A[–6, ..., +8, –6,..., +8] whose base address is 1000? (Assume elements are stored in row major order.)

Question 3

Given an array A[2][2][2], let the address of A be 100.
After executing following code what will be the output? (assume integer takes 4 bytes memory )
int main()
int A[2][2][2] = { { {2,4},{6,8} }, { {10,12},{14,16} } };
printf(“%d %d %d”, A,*(**A + 2), ***(A+1) );

Question 4

Let s be a sorted array of n integers. Let t(n) denote the time taken for the most efficient algorithm to determine if there are two elements with sum less than1000 in s. Which of the following statements is true?

Question 5

Consider a lower triangular matrix. When this lower triangular matrix is stored in array format then only the elements a[i][j] with ij are stored in array i.e only the elements present in lower triangular matrix are stored. Hence less size is consumed to store the array. Consider a lower triangular matrix as [25----85 , 25----85] with base address as 1000 and size of each element in matrix is If the array is stored in row major order then find the address of the element a[60][55] stored in array ________________.

Question 6

Consider a two dimensional array A[2…15][3…10] that is column index ranges from 3 to 10 and row index ranges from 2 to 15 Now suppose element are arranged in column major order. If Base address of A is 1000 then address of element A[5][7] will be __.(Assume size of each element is 1).
  • 1251 attempts