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.
20 on this page
The following C declarations: struct node { int i: float j; }; struct node *s[10]; define s to be:
An array is defined as follows: for all The sum of the elements of the array is
Consider the following program in a language that has dynamic scooping: var x: real; procedure show: begin print(x);end; procedure small; var x: real; begin x: = 0.125; show; end; begin x:=0.25 show; small end. Then the output of the program is:
Given the programming constructs assignment for loops where the loop parameter cannot be changed within the loop if-then-else forward go to arbitrary go to non-recursive procedure call recursive procedure/function call repeat loop, which constructs will you not include in a programming language such that it should be possible to program the terminates (i.e., …
Let be a two dimensional array declared as follows: A: array [1 …. 10] [1 ….. 15] of integer; Assuming that each integer takes one memory location, the array is stored in row-major order and the first element of the array is stored at location , what is the address of the element ?
What is the result of the following program? program side-effect (input, output); var x, result: integer; function f (var x:integer):integer; begin x:x+1;f:=x; end begin x:=5; result:=f(x)*f(x); writeln(result); end
A complete -ary tree is one in which every node has or sons. If is the number of internal nodes of a complete -ary tree, the number of leaves in it is given by
Which of the following statements is false?
Let be the graph with vertices numbered to . Two vertices and are adjacent if or . The number of connected components in is
A priority queue is used to implement a stack that stores characters. PUSH (C) is implemented as INSERT where is an appropriate integer key chosen by the implementation. POP is implemented as DELETEMIN. For a sequence of operations, the keys chosen are in
A binary search tree contains the value . The tree is traversed in pre-order and the values are printed out. Which of the following sequences is a valid output?
Which of the following is essential for converting an infix expression to the postfix form efficiently?
The concatenation of two lists is to be performed on time. Which of the following implementations of a list should be used?
A binary search tree is generated by inserting in order the following integers: The number of nodes in the left subtree and right subtree of the root respectively is
The minimum number of interchanges needed to convert the array into a max-heap is
Which of the following sequences denotes the post order traversal sequence of the below tree?
In the balanced binary tree in the below figure, how many nodes will become unbalanced when a node is inserted as a child of the node “g”?
An advantage of chained hash table (external hashing) over the open addressing scheme is
Consider the following statements: First-in-first out types of computations are efficiently supported by STACKS. Implementing LISTS on linked lists is more efficient than implementing LISTS on an array for almost all the basic LIST operations. Implementing QUEUES on a circular array is more efficient than implementing QUEUES on a linear array with two …
Which of the following statements is true? As the number of entries in a hash table increases, the number of collisions increases. Recursive programs are efficient The worst case complexity for Quicksort is Binary search using a linear linked list is efficient
