Data Structure MCQ
Data Structure MCQ
Total Questions: 30
you'll have 30 second to answer each question.
Quiz Result
Total Questions:
Attempt:
Correct:
Wrong:
Percentage:
Quiz Answers
1. In balancing parentheses algorithm, the string is read from?
left to right
2. What should be done when an opening parentheses is read in a balancing symbols algorithm?
push it on to the stack
3. Which of the following statement is invalid with respect to balancing symbols?
((A+B) + (C+D)
4. What is the number of moves required to solve Tower of Hanoi problem for k disks?
2^k - 1
5. The postfix expression abc+de/*- is equivalent to which of the following infix expression?
a-(b+c)*(d/e)
6. The equivalent infix expression and value for the postfix form 1 2 + 3 * 4 5 * – will be ___________
(1 + 2) * 3 – (4 * 5) and -11
7. What is the value of the postfix expression 2 3 + 4 5 6 – – *
25
8. The prefix expression of the postfix expression AB+CD-* is __________
*+AB-CD
9. Consider the postfix expression 4 5 6 a b 7 8 a c, where a, b, c are operators. Operator a has higher precedence over operators b and c. Operators b and c are right associative. Then, equivalent infix expression is
4 b 5 a 6 c 7 a 8
10. The result of the postfix expression 5 3 * 9 + 6 / 8 4 / + is _____________
6
11. What would be the solution to the given prefix notation? / / / 16 4 2 1
2
12. What would be the solution to the given prefix notation? + 9 * 3 / 8 4
15
13. What would be the solution to the given prefix notation? * / + 1 2 / 4 2 + 3 5
12
14. What is the postfix expression for the corresponding infix expression? a+b*c+(d*e)
abc*+de*+
15. What is the corresponding postfix expression for the given infix expression? a+(b*c(d/e^f)*g)*h)
abcdef^/*g*h*+
16. Who coined the term Sparse Matrix?
Harry Markowitz
17. The matrix contains m rows and n columns. The matrix is called Sparse Matrix if ________
Total number of Zero elements > (m*n)/2
18. In what way the Symmetry Sparse Matrix can be stored efficiently?
Binary tree
19. Which one of the following is a Special Sparse Matrix?
Band Matrix
20. When to choose Red-Black tree, AVL tree and B-trees?
many inserts, many searches and when managing more items respectively
21. How can you save memory when storing color information in Red-Black tree?
using least significant bit of one of the pointers in the node for color information
22. What is the special property of red-black trees and what root should always be?
a color which is either red or black and root should always be black color only
23. What is a threaded binary tree traversal?
a binary tree traversal without using stacks and queues
24. The number of edges from the root to the node is called __________ of the tree.
Depth
25. The number of edges from the node to the deepest leaf is called _________ of the tree.
Height
26. In a full binary tree if there are L leaves, then total number of nodes N are?
N = 2*L - 1
27. In a full binary tree if number of internal nodes is I, then number of leaves L are?
L = I + 1
28. In a full binary tree if number of internal nodes is I, then number of nodes N are?
N = 2*I + 1
29. What is an AVL tree?
a tree which is balanced and is a height balanced tree
30. What is the maximum height of an AVL tree with p nodes?
log(p)
Quiz Result
ReplyDeleteRachna
123
Total Questions: 30
Attempt: 30
Correct: 30
Wrong: 0
Percentage: 100.00%