The GATE Grind

GATE Programming and Data Structures: Arrays – Previous Year Questions

7 GATE previous year questions on Arrays (Programming and Data Structures, Computer Science) with answers and explanations, from every paper.

7 questions worth 11 marks in all (3 1-mark, 4 2-mark). Asked between 2014 and 2021, so you can see how the topic has been tested over time.

  1. GATE 2021 CS (CS2) Q20 (1 mark, Multiple choice) – What is printed by this source C program under its contiguous-array addressing model?
  2. GATE 2015 CS (CS3) Q50 (2 marks, Multiple choice) – In C, Y has length n and X is n×n, 2≤n≤10. Initially Y is zero and X[i][j]=i+j; all of X lies in one memory page frame. Segment 1 loops i=0,…,n−1 with…
  3. GATE 2015 CS (CS2) Q48 (2 marks, Numerical answer) – A Young tableau has unique finite entries increasing along rows and columns; empty cells are ∞, with no finite entry to the right of or below an empty…
  4. GATE 2014 CS (CS3) Q20 (1 mark, Multiple choice) – A is an n × n square matrix. What does this pseudocode output? C = 100; for i = 1 to n do for j = 1 to n do Temp = A[i][j] + C; A[i][j] = A[j][i];…
  5. GATE 2014 CS (CS1) Q51 (2 marks, Multiple choice) – Consider this C function, where size is the number of elements in E: int MyX(int *E, unsigned int size) int Y = 0, Z, i, j, k; for (i = 0; i < size;…
  6. GATE 2016 CS (CS1) Q44 (2 marks, Multiple choice) – The following function computes the maximum value contained in an integer array `p[]` of size n (n 1). The missing loop condition is
  7. GATE 2019 CS Q34 (1 mark, Numerical answer) – Consider the following C program: The number that will be displayed on execution of the program is .