GATE CS Programming & Data Structures Previous Year Questions
17 solved GATE CS questions on Programming & Data Structures, drawn from 1 exam year and grouped by year. Every question shows the official answer and a step-by-step solution.
GATE CS 202417 questions
- Set 1 Q17Given an integer array of size , we want to check if the array is sorted (in either ascending or descending order). An algorithm solves this problem by…MCQ · +1 marks · Easy
- Set 1 Q18Consider the following C program: [code] Which one of the following statements is CORRECT?MCQ · +1 marks · Easy
- Set 1 Q19Consider the following C program: [code] Assume that the input to the program from the command line is 1234 followed by a newline character. Which one of the…MCQ · +1 marks · Medium
- Set 1 Q21In a tree, the requirement of at least half-full (50%) node occupancy is relaxed for which one of the following cases?MCQ · +1 marks · Easy
- Set 1 Q33Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table below. | Operator | Precedence | Associativity…NAT · +1 marks · Medium
- Set 1 Q41An array is heapified. Which one of the following options represents the first three elements in the heapified…MCQ · +2 marks · Medium
- Set 1 Q43Consider a binary min-heap containing 105 distinct elements. Let be the index (in the underlying array) of the maximum element stored in the heap. The…MCQ · +2 marks · Medium
- Set 1 Q45Let be a directed graph and a depth first search (DFS) spanning tree in that is rooted at a vertex . Suppose is also a breadth first search…MSQ · +2 marks · Hard
- Set 1 Q48Consider the following C function definition. [code] Which of the following statements is/are TRUE about the above function?MSQ · +2 marks · Medium
- Set 1 Q60The number of edges present in the forest generated by the DFS traversal of an undirected graph with 100 vertices is 40. The number of connected components…NAT · +2 marks · Easy
- Set 2 Q13Consider the following C program. Assume parameters to a function are evaluated from right to left. [code] Which one of the following options is the CORRECT…MCQ · +1 marks · Medium
- Set 2 Q17Let be the adjacency matrix of a simple undirected graph . Suppose is its own inverse. Which one of the following statements is always TRUE?MCQ · +1 marks · Medium
- Set 2 Q33Consider the following C function definition. [code] Which of the following statements is/are TRUE?MSQ · +1 marks · Medium
- Set 2 Q36What is the output of the following C program? [code]MCQ · +2 marks · Medium
- Set 2 Q39You are given a set of distinct integers. A binary search tree is created by inserting all elements of one by one, starting with an empty tree. The…MCQ · +2 marks · Medium
- Set 2 Q42Consider an array that contains positive integers. A subarray of is defined to be a sequence of array locations with consecutive indices. The C…MCQ · +2 marks · Hard
- Set 2 Q48Let S1 and S2 be two stacks. S1 has capacity of 4 elements. S2 has capacity of 2 elements. S1 already has 4 elements: 100, 200, 300, and 400, whereas S2 is…MSQ · +2 marks · Hard
Other GATE CS topics
Practice Programming & Data Structures with adaptive difficulty
Timed practice, skill tracking, and AI explanations — free to start.
Start practicing free