Data Structure Quiz 15
To improve Knowledge in the field of Data Structures and its basic concepts
Questions
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.
- Yes
- No
- Sometimes yes sometimes no
- Cannot comment
If the keys '1, 2, 3, 4 and 5' are inserted in order into initially empty a AVL tree, the root node is
- 2
- 3
- 4
- 5
If all the edges in a graph are unique, then there is only one minimum spanning tree for the graph.
- Yes
- No
- Sometimes Yes, sometimes No
- Cannot comment
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
- 2
- 3
- 1
- 4
Consider the infix expression ((a + b * c))* d + e * (f + g). If the expression tree is drawn, then the height of the tree, is
- 2
- 3
- 4
- 5
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
- 2
- 3
- 4
Consider the data given below:
Variable Address Contents
p 2568 425
q 4284 2568
r 6242 4284
What is the value of &p?
- 425
- 2568
- 4284
- None of these
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?
- 5
- 6
- 7
- 8
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?
- 2 1/2V<font face="Symbol">1/2</font>
- 2 1/2E1/2
- 2(<font face="Symbol">1/2</font>V1/2 - 1)
- 2(<font face="Arial">1/2</font>E<font face="Arial">1/2</font> - 1)
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?
- 2
- 3
- 4
- 5
Consider the data given below:
Variable Address Contents
p 2568 425
q 4284 2568
r 6242 4284
What is the value of **r?
- 6242
- 4284
- 2568
- None these
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.
- 1028
- 1040
- 1112
- None of these
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?
- 5
- 6
- 7
- 8
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?
- printf(”%d “, *(ptr + i ));
- printf(”%d “, *(ptr)+ i );
- printf(”%d “, (ptr + i ));
- printf(”%d “, *(ptr ));
Consider the data given below:
Variable Address Contents
p 2568 425
q 4284 2568
r 6242 4284
What is the value of *q?
- 4284
- 2568
- 6242
- None these
The memory for S is allocated at
- compile time
- run time
- execution time
- none of these
What is the value of the expression '1 2 3 + * 3 2 1 - + *'?
- 0
- 20
- 10
- None of these
Consider the data given below:
Variable Address Contents
p 2568 425
q 4284 2568
r 6242 4284
What is the value of *(&q)?
- 6242
- 4284
- 2568
- None these
Which of the following is not a valid color of node of graph traversal?
- Black
- Grey
- Red
- White
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.
- 5
- 23
- 32
- none of these
To accept the first_name, which of the following is the appropriate method?
- scanf(“%c”,S.first_name[10]);
- scanf(“%s”,S.first_name[10]);
- scanf(“%s”,S.first_name);
- scanf(“%s”,S->first_name);
Which of the following data structures can be termed as push down list?
- Array
- Stack
- Queue
- Tree
Find the odd one out.
- Ascending priority queue - Min Heap
- Descending priority queue - Max Heap
- Binary Search Tree - Sorting
- B-Tree - Index Sequential Search
Consider the data given below:
Variable Address Contents
p 2568 425
q 4284 2568
r 6242 4284
What is the value of &(*r)?
- 4284
- 2568
- 6242
- none these
If A, B, C, ___, Z represent operands and +, -, *, / represent operators, which of the following does not represent a valid expression?
- A B - C + D E F - +
- + + A - * B C D / + E F * G H I
- + - A B C * D * * E F G
- A B C D E - + * E F *