Data Structure Quiz 15

To improve Knowledge in the field of Data Structures and its basic concepts

25 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Consider a minimum spanning tree T in a graph G. If the weight of an edge e of T is decreased, then the resulting tree T is still a minimum spanning tree.

  1. Yes
  2. No
  3. Sometimes yes sometimes no
  4. Cannot comment
Question 2 Multiple Choice (Single Answer)

If the keys '1, 2, 3, 4 and 5' are inserted in order into initially empty a AVL tree, the root node is

  1. 2
  2. 3
  3. 4
  4. 5
Question 3 Multiple Choice (Single Answer)

If all the edges in a graph are unique, then there is only one minimum spanning tree for the graph.

  1. Yes
  2. No
  3. Sometimes Yes, sometimes No
  4. Cannot comment
Question 4 Multiple Choice (Single Answer)

If the keys '1, 2, 3, 4 and 5' are inserted in order into initially empty a AVL tree, the height of the tree is

  1. 2
  2. 3
  3. 1
  4. 4
Question 5 Multiple Choice (Single Answer)

Consider the infix expression ((a + b * c))* d + e * (f + g). If the expression tree is drawn, then the height of the tree, is

  1. 2
  2. 3
  3. 4
  4. 5
Question 6 Multiple Choice (Single Answer)

If the keys '1, 2, 3, 4 and 5' are inserted in order into initially empty a AVL tree, the total number of rotations required to balance the tree, is

  1. 1
  2. 2
  3. 3
  4. 4
Question 7 Multiple Choice (Single Answer)

Consider the data given below:
Variable Address Contents
p 2568 425
q 4284 2568
r 6242 4284
What is the value of &p?

  1. 425
  2. 2568
  3. 4284
  4. None of these
Question 8 Multiple Choice (Single Answer)

Consider the infix expression ((a + b * c))* d + e * (f + g) If expression tree is drawn, how many nodes are there in the left subtree of root?

  1. 5
  2. 6
  3. 7
  4. 8
Question 9 Multiple Choice (Single Answer)

The cost of every edge in a complete graph G = (V,E) is 2. What is the cost of a spanning tree of the graph?

  1. 2 1/2V<font face="Symbol">1/2</font>
  2. 2 1/2E1/2
  3. 2(<font face="Symbol">1/2</font>V1/2 - 1)
  4. 2(<font face="Arial">1/2</font>E<font face="Arial">1/2</font> - 1)
Question 10 Multiple Choice (Single Answer)

Consider the infix expression ((a + b * c))* d + e * (f + g). If the expression tree is drawn, how many nodes are there at the maximum depth?

  1. 2
  2. 3
  3. 4
  4. 5
Question 11 Multiple Choice (Single Answer)

Consider the data given below:
Variable Address Contents
p 2568 425
q 4284 2568
r 6242 4284
What is the value of **r?

  1. 6242
  2. 4284
  3. 2568
  4. None these
Question 12 Multiple Choice (Single Answer)

Find the address of the element A[3, 8] in the column major order array A[2:7, 4:9] with the base address 1 and each element occupies 4 bytes of memory.

  1. 1028
  2. 1040
  3. 1112
  4. None of these
Question 13 Multiple Choice (Single Answer)

Consider the infix expression ((a + b * c))* d + e * (f + g). If the expression tree is drawn, how many nodes are there in the right subtree of root?

  1. 5
  2. 6
  3. 7
  4. 8
Question 14 Multiple Choice (Single Answer)

void main()
{
int arr[4] = {1, 2,3, 4}
int *ptr = &arr[0], i;
for(i = 0; i < 2; i++)
}
What should be the statement in the blank to print all the elements in the array?

  1. printf(”%d “, *(ptr + i ));
  2. printf(”%d “, *(ptr)+ i );
  3. printf(”%d “, (ptr + i ));
  4. printf(”%d “, *(ptr ));
Question 15 Multiple Choice (Single Answer)

Consider the data given below:
Variable Address Contents
p 2568 425
q 4284 2568
r 6242 4284
What is the value of *q?

  1. 4284
  2. 2568
  3. 6242
  4. None these
Question 16 Multiple Choice (Single Answer)

The memory for S is allocated at

  1. compile time
  2. run time
  3. execution time
  4. none of these
Question 17 Multiple Choice (Single Answer)

What is the value of the expression '1 2 3 + * 3 2 1 - + *'?

  1. 0
  2. 20
  3. 10
  4. None of these
Question 18 Multiple Choice (Single Answer)

Consider the data given below:
Variable Address Contents
p 2568 425
q 4284 2568
r 6242 4284
What is the value of *(&q)?

  1. 6242
  2. 4284
  3. 2568
  4. None these
Question 19 Multiple Choice (Single Answer)

Which of the following is not a valid color of node of graph traversal?

  1. Black
  2. Grey
  3. Red
  4. White
Question 20 Multiple Choice (Single Answer)

Given an structure declaration
Struct student
{
char first_name[10];
char mid_initital;
char last_name[10];
int age;
};
student S;
The declaration of S allocates ________ bytes of memory.

  1. 5
  2. 23
  3. 32
  4. none of these
Question 21 Multiple Choice (Single Answer)

To accept the first_name, which of the following is the appropriate method?

  1. scanf(“%c”,S.first_name[10]);
  2. scanf(“%s”,S.first_name[10]);
  3. scanf(“%s”,S.first_name);
  4. scanf(“%s”,S->first_name);
Question 22 Multiple Choice (Single Answer)

Which of the following data structures can be termed as push down list?

  1. Array
  2. Stack
  3. Queue
  4. Tree
Question 23 Multiple Choice (Single Answer)

Find the odd one out.

  1. Ascending priority queue - Min Heap
  2. Descending priority queue - Max Heap
  3. Binary Search Tree - Sorting
  4. B-Tree - Index Sequential Search
Question 24 Multiple Choice (Single Answer)

Consider the data given below:
Variable Address Contents
p 2568 425
q 4284 2568
r 6242 4284
What is the value of &(*r)?

  1. 4284
  2. 2568
  3. 6242
  4. none these
Question 25 Multiple Choice (Single Answer)

If A, B, C, ___, Z represent operands and +, -, *, / ­represent operators, which of the following does not represent a valid expression?

  1. A B - C + D E F - + ­
  2. + + A - * ­ B C D / + E F * G H I
  3. + - ­ A B C * D * * E F G
  4. A B C D E - + ­ * E F *