Binary Tree using Array and Linked List MCQs

Binary Tree using Array and Linked List MCQs

 Q1. What are the children for node 'w' of a complete-binary tree in an array representation?. 

A. 2w and 2w+1. 

B. 2+w and 2-w. 

C. w+1/2 and w/2. 

D. w-1/2 and w+1/2. 

Answer= 2w and 2w+1


Q2. What is the parent for a node 'w' of a complete binary tree in an array representation when w is not 0?. 

A. floor(w-1/2). 

B. ceil(w-1/2). 

C. w-1/2. 

D. w/2. 

Answer= floor(w-1/2)


Q3. Consider a situation of writing a binary tree into a file with memory storage efficiency in mind, is array representation of tree is good?. 

A. yes because we are overcoming the need of pointers and so space efficiency. 

B. yes because array values are indexable. 

C. No it is not efficient in case of sparse trees and remaning cases it is fine. 

D. No linked list representation of tree is only fine. 

Answer= No it is not efficient in case of sparse trees and remaning cases it is fine


Q4. Can a tree stored in an array using either one of inorder or post order or pre order traversals be again reformed?. 

A. yes just traverse through the array and form the tree. 

B. No we need one more traversal to form a tree. 

C. No in case of sparse trees. 

D. None of the mentioned. 

Answer= No we need one more traversal to form a tree


Q5. Advantages of linked list representation of binary trees over arrays?. 

A. dynamic size. 

B. ease of insertion/deletion. 

C. ease in randomly accessing a node. 

D. both dynamic size and ease in insertion/deletion. 

Answer= both dynamic size and ease in insertion/deletion


Q6. Disadvantages of linked list representation of binary trees over arrays?. 

A. Randomly accessing is not possible. 

B. Extra memory for a pointer is needed with every element in the list. 

C. Difficulty in deletion. 

D. Random access is not possible and extra memory with every element. 

Answer= Random access is not possible and extra memory with every element


Q7. How to travel a tree in linkedlist representation?. 

A. using post order traversing. 

B. using pre order traversing. 

C. using post order traversing. 

D. all of the mentioned. 

Answer= all of the mentioned


Q8. Level order traversal of a tree is formed with the help of. 

A. breadth first search. 

B. depth first search. 

C. dijkstra's algorithm. 

D. prims algorithm. 

Answer= breadth first search


Q9. Why we prefer threaded binary trees?. 

A. storage required by stack and queue is more. 

B. pointers in most of nodes of a binary tree are NULL. 

C. difficult to find a successor node. 

D. all of the mentioned. 

Answer= all of the mentioned


Q10. The following lines talks about deleting a node in a binary tree.(the tree property must not be violated after deletion)i) from root search for the node to be deletedii)iii) delete the node at what must be statement ii) and fill up statement iii). 

A. ii)-find random node,replace with node to be deleted. iii)- delete the node. 

B. ii)-find node to be deleted. iii)- delete the node at found location. 

C. ii)-find deepest node,replace with node to be deleted. iii)- delete a node. 

D. ii)-find deepest node,replace with node to be deleted. iii)- delete the deepest node. 

Answer= ii)-find deepest node,replace with node to be deleted. iii)- delete the deepest node


Q11. What may be the psuedo code for finding the size of a tree?. 

A. find_size(root_node->left_node) + 1 + find_size(root_node->right_node). 

B. find_size(root_node->left_node) + find_size(root_node->right_node). 

C. find_size(root_node->right_node) - 1. 

D. find_size(root_node->left_node + 1. 

Answer= find_size(root_node->left_node) + 1 + find_size(root_node->right_node)


Q12. What is the maximum number of children that a binary tree node can have?. 

A. 0. 

B. 1. 

C. 2. 

D. 3. 

Answer= 2


Q13. A binary tree is a rooted tree but not an ordered tree.. 

A. TRUE. 

B. FALSE. 

C.  Nothing can be said. 

D.  None of the mentioned. 

Answer= FALSE


Q14. How many common operations are performed in a binary tree?. 

A. 1. 

B. 2. 

C. 3. 

D. 4. 

Answer= 3

Previous Post Next Post