Array Concepts MCQs & GATE PYQs - Data Structure [ GATE CSE ]

Array List MCQs & GATE PYQs - Data Structure

Master Array for your Data Structure course and the GATE exam. This guide covers key concepts, essential MCQs, and previous year questions (PYQs) to sharpen your skills in Array.

Array Concepts, tricks , Tips

Array basics: contiguous memory, indexing starts at 0 in C/C++/Java, row-major layout for 2D arrays in C, typical boundary checks, pitfalls with off-by-one errors.

  • 2D arrays: element address = base + ((i * numCols) + j) * elementSize (row-major)
  • SIP tricks: practice binary search, two-pointer, and prefix-sum problems on arrays.

Array Practice MCQs & GATE PYQs

1. An array A of length n with distinct elements is said to be bitonic if there is an index 1 ≤ i ≤ n such that A[1..i] is sorted in the non-decreasing order and A[i+1..n] is sorted in the non-increasing order.

Which ONE of the following represents the best possible asymptotic bound for the worst-case number of comparisons by an algorithm that searches for an element in a bitonic array A? [ GATE CSE 2025 SET-2 ]

2. Let A be an array containing integer values. The distance of A is defined as the minimum number of elements in A that must be replaced with another integer so that the resulting array is sorted in non-decreasing order. The distance of the array [2,5,3,1,4,2,6] is _____ [ GATE CSE 2024 SET-2 ]

3. What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size n? [ GATE CSE 2021 SET-2 ]

4. 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 arbitrary array of n elements. Which one of the following choices is correct? [ GATE CSE 2021 SET-1 ]

5. If an array A contains the items 10, 4, 7, 23, 67, 12 and 5 in that order, what will be the resultant array A after third pass of insertion sort? [ ISRO CSE 2020 ]

Post a Comment

0 Comments