KD Tree and expression Tree MCQs

KD Tree and expression Tree MCQs

 Q1. Which of the following is the simplest data structure that supports range searching?. 

A. Heaps. 

B. binary search trees. 

C. AA-trees. 

D. K-d trees. 

Answer= K-d trees


Q2. In a k-d tree, k originally meant?. 

A. number of dimensions. 

B. size of tree. 

C. length of node. 

D. weight of node. 

Answer= number of dimensions


Q3. Each level in a k-d tree is made of?. 

A. dimension only. 

B. cutting and dimension. 

C. color code of node. 

D. size of the level. 

Answer= cutting and dimension


Q4. What is the worst case of finding the nearest neighbour?. 

A. O(N). 

B. O(N log N). 

C. O( log N). 

D. O(N3). 

Answer= O(N)


Q5. What is the run time of finding the nearest neighbour in a k-d tree?. 

A. O(2+ log N). 

B. O( log N). 

C. O(2d log N). 

D. O( N log N). 

Answer= O(2d log N)


Q6. How many prime concepts are available in nearest neighbour search in a kd tree?. 

A. 1. 

B. 2. 

C. 3. 

D. 4. 

Answer= 3


Q7. Reducing search space by eliminating irrelevant trees is known as?. 

A. pruning. 

B. partial results. 

C. freeing space. 

D. traversing. 

Answer= pruning


Q8. Several kinds of queries are possible on a k-d called as?. 

A. partial queries. 

B. range queries. 

C. neighbour queries. 

D. search queries. 

Answer= range queries


Q9. The 2d search tree has the simple property that branching on odd levels is done with respect to the first key.. 

A. TRUE. 

B. FALSE. 

C.  Nothing Can be said. 

D.  None of the mentioned. 

Answer= TRUE


Q10. Who invented k-d trees?. 

A. Arne Andersson. 

B. Jon Bentley. 

C. Jon Von Newmann. 

D. Rudolf Bayer. 

Answer= Jon Bentley


Q11. The leaves of an expression tree always contain?. 

A. operators. 

B. operands. 

C. null. 

D. expression. 

Answer= operands


Q12. A node can have a minimum of one child.. 

A. TRUE. 

B. FALSE. 

C.  Nothing can be said. 

D.  None of the mentioned. 

Answer= TRUE


Q13. What does the other nodes of an expression tree(except leaves) contain?. 

A. only operands. 

B. only operators. 

C. both operands and operators. 

D. expression. 

Answer= only operators


Q14. An expression tree is a kind of?. 

A. Binary search tree. 

B. Fibonacci tree. 

C. Binary tree. 

D. Treap. 

Answer= Binary tree


Q15. The expression obtained by recursively producing a left expression, followed by an operator, followed by recursively producing a right expression is called?. 

A. prefix expression. 

B. infix expression. 

C. postfix expression. 

D. paranthesized expression. 

Answer= infix expression


Q16. The average depth of a binary tree is given as?. 

A. O(N). 

B. O(log N). 

C. O(M log N). 

D. O(√N). 

Answer= O(√N)


Q17. Only infix expression can be made into an expression tree.. 

A. TRUE. 

B. FALSE. 

C.  Nothing can be said. 

D.  None of the mentioned. 

Answer= FALSE


Q18. An expression tree is created using?. 

A. postfix expression. 

B. prefix expression. 

C. infix expression. 

D. paranthesized expression. 

Answer= postfix expression


Q19. " ++a*bc*+defg " is an?. 

A. postfix expression. 

B. infix expression. 

C. prefix expression. 

D. invalid expression. 

Answer= prefix expression


Q20. An expression tree's nodes can be deleted by calling?. 

A. malloc. 

B. calloc. 

C. delete. 

D. free. 

Answer= free


Q21. In an expression tree algorithm, what happens when an operand is encountered?. 

A. create one node pointing to a stack. 

B. pop the nodes from the stack. 

C. clear stack. 

D. merge all the nodes. 

Answer= create one node pointing to a stack


Q22. In a max-heap, element with the greatest key is always in the which node?. 

A. Leaf node. 

B. First node of left sub tree. 

C. root node. 

D. First node of right sub tree. 

Answer= root node


Q23. Heap exhibits the property of a binary tree?. 

A. TRUE. 

B. FALSE. 

C.  Nothing can be said. 

D.  None of the mentioned. 

Answer= TRUE


Q24. What is the complexity of adding an element to the heap.. 

A. O(log n). 

B. O(h). 

C. O(log n) & O(h). 

D. None of the mentioned. 

Answer= O(log n) & O(h)

Previous Post Next Post