Skip to content

GATE CS Programming and Data Structures questions

Practise Programming and Data Structures questions for GATE CS. Explore official PYQs and original subject-wise quizzes, check answers and view available solutions. Free, no sign-in.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

18 on this page
Official PYQ1995Programming and Data StructuresArrays, Stacks and QueuesMCQ · 1 mark
The postfix expression for the infix expression A+B∗(C+D)/F+D∗EA+B*(C+D)/F+D*E is:
Official PYQ1995Programming and Data StructuresTreesMCQ · 1 mark
A binary tree TT has nn leaf nodes. The number of nodes of degree 22 in TT is
Official PYQ1994Programming and Data StructuresRecursionNAT · 1 mark
Consider the following recursive function: function fib (n:integer);integer; begin if (n=0) or (n=1) then fib := 1 else fib := fib(n-1) + fib(n-2) end; The above function is run on a computer with a stack of 6464 bytes. Assuming that only return address and parameter are passed on the stack, and that an integer value and an address takes 22 bytes each, …
Official PYQ1994Programming and Data StructuresLinked ListsMCQ · 1 mark
Linked lists are not suitable data structures for which one of the following problems?
Official PYQ1994Programming and Data StructuresArrays, Stacks and QueuesMCQ · 1 mark
Which of the following permutations can be obtained in the output (in the same order) using a stack assuming that the input is the sequence 1, 2, 3, 4, 5\text{1, 2, 3, 4, 5} in that order?
Official PYQ1994Programming and Data StructuresArrays, Stacks and QueuesMCQ · 1 mark
In a compact single dimensional array representation for lower triangular matrices (i.e all the elements above the diagonal are zero) of size n×nn \times n, non-zero elements, (i.e elements of lower triangle) of each row are stored one after another, starting from the first row, the index of the (i,j)th(i, j)^{th} element of the lower triangular matrix in this …
Official PYQ1994Programming and Data StructuresProgramming in CMCQ · 1 mark
An unrestricted use of the "gotogoto" statement is harmful because
Official PYQ1994Programming and Data StructuresProgramming in CMCQ · 1 mark
In which of the following cases is it possible to obtain different results for call-by-reference and call-by-name parameter passing methods?
Official PYQ1992Programming and Data StructuresTreesMSQ · 1 mark
A 2−32-3 tree is such that All internal nodes have either 22 or 33 children All paths from root to the leaves have the same length The number of internal nodes of a 2−32-3 tree having 99 leaves could be
Official PYQ1991Programming and Data StructuresArrays, Stacks and QueuesMCQ · 1 mark
The following sequence of operations is performed on a stack: PUSH(10),PUSH(20),POP,PUSH(10),PUSH(20),POP,POP,POP,PUSH(20),POPPUSH (10), PUSH (20), POP, PUSH (10), PUSH (20), POP, POP, POP, PUSH (20), POP The sequence of values popped out is
Official PYQ1991Programming and Data StructuresRecursionNAT · 1 mark
Consider the following recursive definition of fibfib: fib(n) := if n = 0 then 1 else if n = 1 then 1 else fib(n-1) + fib(n-2) The number of times fibfib is called (including the first call) for evaluation of fib(7)fib(7) is___________.
Official PYQ1991Programming and Data StructuresTreesNAT · 1 mark
The weighted external path length of the binary tree in figure is ______
Official PYQ1990Programming and Data StructuresTreesMCQ · 1 mark
The total external path length, EPL,\text{EPL}, of a binary tree with nn external nodes is, EPL=∑wIw\text{EPL}= \displaystyle \sum_{w} I_w, where IwI_{w} is the path length of external node ww),
Official PYQ1989Programming and Data StructuresTreesMSQ · 1 mark
Which one of the following statements (s) is/are FALSE?
Official PYQ1989Programming and Data StructuresProgramming in CMCQ · 1 mark
An unrestricted use of the "go to" statement is harmful because of which of the following reason (s):
Official PYQ1987Programming and Data StructuresTreesNAT · 1 mark
State whether the following statements are TRUE or FALSE: If the number of leaves in a tree is not a power of 2,2, then the tree is not a binary tree.
Official PYQ1987Programming and Data StructuresTreesNAT · 1 mark
State whether the following statements are TRUE or FALSE: It is possible to construct a binary tree uniquely whose pre-order and post-order traversals are given?
Official PYQ1987Programming and Data StructuresLinked ListsMCQ · 1 mark
In a circular linked list organization, insertion of a record involves modification of