ISRO CS Data Structures and Algorithms PYQs: 6 Solved Questions

Six exact ISRO Data Structures and Algorithms previous-year questions, with options, correct answers and explanations covering arrays, trees, searching, BFS and sorting.

KnowledgeGate Team

Exam prep & CS education

21 Sep 20265 min read166 views

Data Structures and Algorithms questions in ISRO CS often look short, but a single word such as row-major, complete, average, FIFO or swaps decides the method.

Below are six exact ISRO previous-year questions with their original options, correct answers and clear explanations.

Use the ISRO Scientist/Engineer SC Computer Science course for the complete exam route, or strengthen the underlying concepts through the Data Structures course and Coding and Skills category.

Identify the deciding rule before calculating

  • Row-major array: move across columns before moving to the next row.

  • Complete K-ary tree: compare the geometric sums for internal nodes and all nodes.

  • Binary search: the data must be sorted, and average comparisons come from decision-tree levels.

  • Breadth-first search: the frontier must be processed in first-in, first-out order.

  • Minimum swaps: count element exchanges, not comparisons or shifts.

1. Row-major array addressing — ISRO CS 2020

Question

Consider a 2-dimensional array x with 10 rows and 4 columns, with each element storing a value equivalent to the product of the row number and column number. The array is stored in row-major format. If the first element x[0][0] occupies the memory location with address 1000 and each element occupies only one memory location, which locations (in decimal) hold a value of 10?

  • (A) 1018, 1019

  • (B) 1022, 1041

  • (C) 1017, 1036

  • (D) 1000, 1399

Correct answer: (C) 1017, 1036

Explanation

For zero-based indices, row-major addressing is Address = Base + (i × number of columns + j). The value uses one-based row and column numbers, so we need factor pairs of 10 that fit 10 rows and 4 columns: row 5 with column 2, and row 10 with column 1.

These correspond to indices (4,1) and (9,0). Their addresses are 1000 + (4 × 4 + 1) = 1017 and 1000 + (9 × 4 + 0) = 1036.

2. Complete K-ary tree ratio — ISRO CS 2020

Question

Of the following, which best approximates the ratio of the number of non-terminal nodes in the total number of nodes in a complete K-ary tree of depth N?

  • (A) 1/N

  • (B) (N-1)/N

  • (C) 1/K

  • (D) (K-1)/K

Correct answer: (C) 1/K

Explanation

At depth N, a complete K-ary tree has approximately K^N leaves. The total number of nodes is the geometric sum 1 + K + K² + ... + K^N, while non-terminal nodes stop at level N-1.

For large N, leaves approach a fraction (K-1)/K of all nodes. Non-terminal nodes are the complement, so their fraction approaches 1/K. The trap is choosing the leaf ratio instead of the internal-node ratio.

3. Binary-search precondition — ISRO CS 2016

Question

The necessary condition for using binary search in an array is:

  • (A) The array should not be too long

  • (B) The array should of more size

  • (C) The array should be sorted

  • (D) None of these

Correct answer: (C) The array should be sorted

Explanation

Binary search compares the key with the middle element and discards one half. That elimination is valid only when the elements are in a known sorted order. Array length affects the number of comparisons, not whether the algorithm is correct.

The quick check is simple: if the stem says binary search, first confirm sorted input. Without order, the middle comparison gives no information about which side may contain the key.

4. Breadth-first search data structure — ISRO CS 2017

Question

Which of the following data structure is useful in traversing a given graph by breadth first search?

  • (A) Stack

  • (B) List

  • (C) Queue

  • (D) None of the above

Correct answer: (C) Queue

Explanation

BFS visits vertices level by level. A queue preserves the order in which vertices are discovered: the earliest discovered vertex is processed first. This first-in, first-out rule finishes the current frontier before moving deeper.

A stack reverses that order and produces depth-first behaviour. “List” is too general because it does not state the required FIFO discipline.

5. In-place sorting with minimum swaps — ISRO CS 2017

Question

Which one of the following in-place sorting algorithms needs the minimum number of swaps?

  • (A) Insertion Sort

  • (B) Quick Sort

  • (C) Heap Sort

  • (D) Selection Sort

Correct answer: (D) Selection Sort

Explanation

Selection Sort finds the smallest remaining element and places it in its final position with at most one swap per pass. Therefore, it performs at most n-1 swaps.

Quick Sort swaps during partitioning, while Heap Sort swaps repeatedly during heap maintenance. Insertion Sort may shift or exchange many elements. The question asks about swaps, not comparisons or total running time.

6. Average successful binary search — ISRO CS 2014

Question

Suppose there are 11 items in sorted order in an array. How many searches are required on the average, if binary search is employed and all searches are successful in finding the item?

  • (A) 3.00

  • (B) 3.46

  • (C) 2.81

  • (D) 3.33

Correct answer: (A) 3.00

Explanation

Represent successful binary search as a decision tree. For 11 items, the levels contain 1, 2, 4 and 4 items. Their comparison costs are 1, 2, 3 and 4 respectively.

The total is 1 × 1 + 2 × 2 + 4 × 3 + 4 × 4 = 33 comparisons across 11 successful searches. Therefore, the average is 33/11 = 3.00. Using only log₂11 gives a useful height estimate, but not the exact successful-search average.

ISRO Data Structures revision diagram covering row-major addressing, K-ary trees, binary search, BFS queues and minimum-swap sorting.

Common traps in these ISRO PYQs

Question type

Tempting mistake

Correct check

Row-major array

Use one-based row numbers directly as indices

Convert positions to zero-based indices first

K-ary tree

Choose the leaf ratio

The question asks for non-terminal nodes

Binary-search condition

Focus on array size

The required property is sorted order

BFS

Choose a stack because traversals feel recursive

BFS needs FIFO queue order

Sorting swaps

Compare time complexity instead of swaps

Selection Sort uses at most one swap per pass

Average binary search

Round log₂n

Weight every decision-tree level

For more ISRO subject-wise practice, continue with the ISRO CS DBMS PYQ walkthrough and the ISRO CS Operating Systems PYQ guide.

A short revision loop

Attempt all six questions again without reading the explanations. For every error, write one deciding rule: row-major uses columns in the offset, internal K-ary ratio approaches 1/K, binary search needs sorted data, BFS uses a queue, Selection Sort minimises swaps, and exact averages come from weighted tree levels.

Then solve the options again. This turns each fact into a reusable elimination rule instead of an isolated answer