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

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.
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 ISRO Programming, Data Structures and Algorithms module.
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^2 + ... + 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 log2(11) gives a useful height estimate, but not the exact successful-search average.

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 log2 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.
Use each answer choice as a diagnostic signal
A missed option is useful only when you can name the trigger that should have ruled it out. Keep a six-row error log with the question family, the option you chose, and the first check you skipped. The correction then becomes a reusable decision rule rather than another answer to memorise.
For these questions, an address error points to the index base or row stride; a K-ary-tree error points to confusing leaves with non-terminal nodes; a binary-search error points to the sorted-order invariant; a BFS error points to losing FIFO order; a sorting error points to counting comparisons instead of swaps; and a 3.00 error points to giving every decision-tree level the same weight.
Re-solve only the missed questions after a day, then take a fresh Data Structures and Algorithms set without looking at the options first. If the same trigger fails twice, revise that concept before adding more questions. The ISRO Scientist/Engineer SC Computer Science course provides the wider subject route, while the linked practice pages keep each rule tied to its original question.
Use the printed years as provenance, not as a forecast of what the next paper will ask. The durable value is the method: translate the stem into an invariant, compute only after the representation is fixed, and reject options that violate that invariant. That habit transfers from this six-question set to new ISRO DSA questions.
Keep learning
ISRO CS Theory of Computation and Compiler Design PYQs: 7 Solved Questions
Seven exact ISRO Theory of Computation and Compiler Design previous-year questions, with options, correct answers and clear explanations.
ISRO CS Computer Organization and Architecture PYQs: 7 Solved Questions
Seven exact ISRO Computer Organization and Architecture previous-year questions, with options, correct answers and clear explanations covering cache, memory, control units, interrupts and addressing modes.
ISRO CS Computer Networks PYQs: Solved OSPF, CSMA and TCP Questions
Six exact ISRO Computer Networks previous-year questions, with options, correct answers and explanations covering NAT, OSPF, CSMA and TCP.
ISRO CS DBMS PYQs: Solved Patterns for Keys, Normalisation, SQL and Transactions
Learn to classify and solve representative ISRO CS DBMS problems through closures, normal forms, SQL row tracing, index I/O and precedence graphs.





