Time Left - 15:00 mins
GATE CS 2022 : Data structure -3
Attempt now to get your rank among 337 students!
Question 1
include <stdio.h>
static int i=20;
int main ( )
{
i=5;
for (i=0;i<5;i++)
{
static int x=20;
printf(“%d”, x++);
}
return 0;
}
What is the output?
static int i=20;
int main ( )
{
i=5;
for (i=0;i<5;i++)
{
static int x=20;
printf(“%d”, x++);
}
return 0;
}
What is the output?
Question 2
What will be the output of following code?
#include<stdio.h>
int main()
{
int i=3, *j, k=0;
j = &i;
printf("%d%d\n", i**j*i+*j,k);
return 0;
}
#include<stdio.h>
int main()
{
int i=3, *j, k=0;
j = &i;
printf("%d%d\n", i**j*i+*j,k);
return 0;
}
Question 3
Consider the following function:
What is the number of recursive calls made by the above function considering the assumption that n>=m?
What is the number of recursive calls made by the above function considering the assumption that n>=m?
Question 4
Consider a sorted circular doubly-linked list where the head element points to the smallest element in the list, so what is the complexity in terms of Big-Oh for determining the median element in this doubly-linked list?
Question 5
Given a sequence of operation performed on a stack:
PUSH(2) ,PUSH(4) ,POP , PUSH(6), PUSH(7), POP, POP, PUSH(9), POP, POP
What will be the sequence of value popped out?
PUSH(2) ,PUSH(4) ,POP , PUSH(6), PUSH(7), POP, POP, PUSH(9), POP, POP
What will be the sequence of value popped out?
Question 6
Which of the following data structure used by recursion?
- 337 attempts
- 5 upvotes
- 6 comments
May 12GATE & PSU CS