Tree_Quiz.pdf
Document Details
Uploaded by SereneCalcium
St. Paul University Quezon City
Tags
Full Transcript
Quiz on Trees 1. What is a tree in data structures? a) A structure with a linear organization of data b) A data structure consisting of nodes connected by edges c) A set of unconnected nodes Answer: b) A data structure consisting of nodes connected b...
Quiz on Trees 1. What is a tree in data structures? a) A structure with a linear organization of data b) A data structure consisting of nodes connected by edges c) A set of unconnected nodes Answer: b) A data structure consisting of nodes connected by edges 2. Which of the following is the topmost node of a tree? a) Leaf b) Node c) Root Answer: c) Root 3. Which term refers to a node with no children? a) Edge b) Leaf c) Root Answer: b) Leaf 4. In which traversal method is the root node visited first? a) In-order traversal b) Pre-order traversal c) Post-order traversal Answer: b) Pre-order traversal 5. What is a Binary Search Tree (BST)? a) A tree where each node has at most two children b) A binary tree where the left child is less than the parent and the right child is greater c) A tree where nodes can have more than two children Answer: b) A binary tree where the left child is less than the parent and the right child is greater 6. Which of the following tree types is self-balancing? a) Binary Search Tree b) AVL Tree c) Heap Tree Answer: b) AVL Tree 7. What is the main characteristic of a Max-Heap? a) The value of each node is less than its children b) The value of each node is greater than or equal to its children c) The tree contains cycles Answer: b) The value of each node is greater than or equal to its children 8. What is the main use of a Trie data structure? a) Storing numerical values b) Storing strings and supporting prefix matching c) Sorting binary trees Answer: b) Storing strings and supporting prefix matching 9. What is the process of visiting all the nodes in a tree called? a) Searching b) Traversal c) Insertion Answer: b) Traversal 10. Which of the following is an advantage of using trees? a) Linear organization of data b) Efficient searching and retrieval c) Always simpler than other data structures Answer: b) Efficient searching and retrieval