Skip to content
Early access — you're among the first to try PYQLabs. Share feedback
Concept drill

array

GATE CSE & IT · Logical Reasoning - Puzzles · 1996-2025

14
PYQs
93%
keyed
0
elite explanations
9
years appeared

Study anchor

Source-book anchor pending for this concept.

Practice action

Start latest PYQ

PYQs in this concept

All concepts →
2025 Q33

The pseudocode of a function fun () is given below: fun(int A[0,...,n-1]){ for i=0 to n-2 for j=0 to n-i-2 if (A[j]>A[j+1]) then swap A[j] and A[j+1] } Let A[0, ...,29] be an array...

mediumanswer key
2025 Q61

#include int foo(int S[],int size) { if(size == 0) return 0; if(size == 1) return 1; if(S[0] != S[1]) return 1+foo(S+1,size-1); return foo(S+1,size-1); } int main() { int A[]={0,1,...

mediumanswer key
2025 PYQ

Consider an unordered list of $N$ distinct integers. What is the minimum number of element comparisons required to find an integer in the list that is NOT the largest in the list?

easyanswer keybasic explanation
2024 Q10

In the 4 x 4 array shown below, each cell of the first three rows has either a cross (X) or a number. 1 X 4 3 X 5 5 4 3 X 6 X The number in a cell represents the count of the immed...

mediumanswer key
2024 Q41

An array [82, 101, 90, 11, 111, 75, 33, 131, 44, 93] is heapified. Which one of the following options represents the first three elements in the heapified array?

mediumanswer key
2024 Q42

Consider an array X that contains n positive integers. A subarray of X is defined to be a sequence of array locations with consecutive indices. The C code snippet given below has b...

mediumanswer key
2021 PYQ

Let P be an array containing n integers. Let t be the lowest upper bound on the number of comparisons of the array elements, required to find the minimum and maximum values in an a...

mediumanswer keybasic explanation
2015 PYQ

An unordered list contains $$n$$ distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is

easyanswer key
2014 PYQ

The minimum number of comparisons required to find the minimum and the maximum of 100 numbers is ________

easy
2014 PYQ

Let A be a square matrix size $$n \times n$$. Consider the following pseudocode. What is the expected output? C = 100; for i = 0 to n do for j = 1 to n do { Temp = A[ i ][ j ] + C...

easyanswer key
2007 PYQ

An array of n numbers is given, where n is an even number. The maximum as well as the minimum of these n numbers needs to be determined. Which of the following is TRUE about the nu...

mediumanswer key
2006 PYQ

An element in an array X is called a leader if it is greater than all elements to the right of it in X. The best algorithm to find all leaders in an array

easyanswer key
2005 PYQ

A program P reads in 500 integers in the range [0, 100] representing the cores of 500 students. It then print the frequency of each score above 50. What would be the best way for P...

easyanswer key
1996 PYQ

Consider the following statements: (i) First-in-first out types of computations are efficiently supported by STACKS. (ii) Implementing LISTS on linked lists is more efficient than...

easyanswer key