Time Left - 12:00 mins

# BARC 2020: Data Structures and Programming Nuclear Quiz 2 (App update required to attempt this test)

Attempt now to get your rank among 670 students!

Question 1

Consider the following C function.

The return value of fun (5) is

The return value of fun (5) is

________________.Question 2

Consider the following C program.

# include<stdio.h>

int main( )

{

static int a[] = {10, 20, 30, 40, 50};

static int *p[] = {a, a+3, a+4, a+1, a+2};

int **ptr = p;

ptr++;

printf("%d%d", ptr - p, **ptr);

}

The output of the program is.

Question 3

Consider the following directed graph:

The number of different topological orderings of the vertices of the graph is __________.

The number of different topological orderings of the vertices of the graph is __________.

Question 4

Let Q denote a queue containing sixteen numbers and S be an empty stack. Head(Q) returns the element at the head of the queue Q without removing it from Q. Similarly Top(S) returns the element at the top of S without removing it from S. Consider the algorithm given below.

while Q is not Empty do

The maximum possible number of iterations of the while loop in the algorithm is _________.

while Q is not Empty do

The maximum possible number of iterations of the while loop in the algorithm is _________.

Question 5

Find the average number of key comparisons required for an unsuccessful search of a random binary search tree with 14 nodes and 50 as external path length.

Question 6

The equivalent prefix expression for the following infix expression (A+B)-(C+D*E)/F*G is

Question 7

Consider a lower triangular matrix. When this lower triangular matrix is stored in array format then only the elements a[i][j] with ij are stored in array i.e only the elements present in lower triangular matrix are stored. Hence less size is consumed to store the array. Consider a lower triangular matrix as [25----100 , 25----100] with base address as 1000 and size of each element in matrix is 10, If the array is stored in column major order then find the address of the element a[80][45] stored in array ________________.

Question 8

Consider the following program

int find (int n)

{

int gate = 1;

for (i = 1; i < = n; i++)

for (j=1; j < = i; j++)

for (k = 1; k < = j; k++)

gate = gate +1;

return gate;

}

What is the value returned by find (10)?

int find (int n)

{

int gate = 1;

for (i = 1; i < = n; i++)

for (j=1; j < = i; j++)

for (k = 1; k < = j; k++)

gate = gate +1;

return gate;

}

What is the value returned by find (10)?

Question 9

How many minimum spanning trees are possible for following graph?

Question 10

The minimum number of interchanges required to convert this heap into a min-heap.

- 670 attempts
- 0 upvotes
- 0 comments

Feb 22GATE & PSU CS

Posted by: