# 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.

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.

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.

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).

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).

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

A. 1.

B. 2.

C. 3.

D. 4.

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

A. pruning.

B. partial results.

C. freeing space.

D. traversing.

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.

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.

Q10. Who invented k-d trees?.

B. Jon Bentley.

C. Jon Von Newmann.

D. Rudolf Bayer.

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

A. operators.

B. operands.

C. null.

D. expression.

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

A. TRUE.

B. FALSE.

C.  Nothing can be said.

D.  None of the mentioned.

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.

Q14. An expression tree is a kind of?.

A. Binary search tree.

B. Fibonacci tree.

C. Binary tree.

D. Treap.

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.

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).

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.

Q18. An expression tree is created using?.

A. postfix expression.

B. prefix expression.

C. infix expression.

D. paranthesized expression.

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

A. postfix expression.

B. infix expression.

C. prefix expression.

D. invalid expression.

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

A. malloc.

B. calloc.

C. delete.

D. 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.

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

A. TRUE.

B. FALSE.

C.  Nothing can be said.

D.  None of the mentioned.