Subject-wise GATE questions

Programming and Data Structures

12 questions and papers

GATE CS 2019 — Question 12

Numerical answer 1 mark GATE CS — Computer Science & IT 2019

Consider the following C program:#include <stdio.h> int jumble(int x, int y) { x = 2 * x + y; return x; } int main() { int x =…

GATE CS 2018 — Question 36

Multiple choice 2 marks GATE CS — Computer Science & IT 2018

Consider the following C program:#include <stdio.h> struct Ournode { char x, y, z; }; int main() { struct Ournode p = {'1', '0', 'a' + 2}; struct Ournode…

GATE CS 2016 Set 1 — Question 13

Multiple choice 1 mark GATE CS — Computer Science & IT 2016

Consider the following C program:void f(int, short); void main() { int i = 100; short s = 12; short *p = &s; __________ ; /* call to f()…

GATE CS 2017 Set 1 — Question 44

Numerical answer 2 marks GATE CS — Computer Science & IT 2017

Consider the following C program:#include <stdio.h> int *A, stkTop; int stkFunc(int opcode, int val) { static int size = 0, stkTop = 0; switch (opcode) { case -1:…

GATE CS 2015 Set 2 — Question 41

Multiple choice 2 marks GATE CS — Computer Science & IT 2015

Consider a max-heap stored in an array using the usual level-order (breadth-first) representation:40, 30, 20, 10, 15, 16, 17, 8, 4The value 35 is now inserted into this…

GATE CS 2015 Set 1 — Question 35

Numerical answer 2 marks GATE CS — Computer Science & IT 2015

Consider the following function written in C:int f(int n) { static int i = 1; if (n >= 5) return n; n = n + i; i++; return…

GATE CS 2014 Set 3 — Question 41

Multiple choice 2 marks GATE CS — Computer Science & IT 2014

Consider the following function:int f(int n) { static int r = 0; if (n <= 0) return 1; if (n > 3) { r = n; return f(n…

GATE CS 2010 — Question 35

Multiple choice 2 marks GATE CS — Computer Science & IT 2010

The following C function takes a singly linked list as an input argument. It modifies the list by moving the last element to the front of the list…

GATE CS 2007 — Question 55

Multiple choice 2 marks GATE CS — Computer Science & IT 2007

The following postfix expression with single-digit operands is evaluated using a stack:8 2 3 ^ / 2 3 * + 5 1 * -Note that ^ is the…

GATE CS 2007 — Question 12

Multiple choice 1 mark GATE CS — Computer Science & IT 2007

The maximum number of binary trees that can be formed with three unlabelled nodes is: