Q. What traversal method is used to copy a binary tree?
A.
Pre-order
B.
In-order
C.
Post-order
D.
Level-order
Solution
Pre-order traversal is often used to copy a binary tree because it processes the root node before its children, allowing for a straightforward reconstruction.
Q. Which of the following is a real-world application of binary trees?
A.
File system organization
B.
Web page ranking
C.
Network routing
D.
Data compression
Solution
Binary trees are commonly used to represent hierarchical data structures, such as file systems, where directories and files are organized in a tree format.
Q. Which traversal method is best suited for copying a binary tree?
A.
In-order
B.
Pre-order
C.
Post-order
D.
Level-order
Solution
Pre-order traversal is best suited for copying a binary tree because it processes the root node before its children, allowing for a straightforward reconstruction.
Q. Which traversal method would you use to delete a binary tree?
A.
Pre-order
B.
In-order
C.
Post-order
D.
Level-order
Solution
Post-order traversal is used to delete a binary tree because it ensures that child nodes are deleted before their parent nodes, preventing memory leaks.