Podcast
Questions and Answers
In a binary tree of 6 levels, how many times will the while loop execute during insertion?
In a binary tree of 6 levels, how many times will the while loop execute during insertion?
- 8 times
- 6 times (correct)
- 5 times
- 7 times
What does the comparison in the while loop reflect if it is true during insertion?
What does the comparison in the while loop reflect if it is true during insertion?
- The number in the node where the pointer p is pointing is not equal to 17 and q is NULL.
- The number in the node where the pointer p is pointing is not equal to 17 and q is not NULL. (correct)
- The number in the node where the pointer p is pointing is equal to 17 and q is not NULL.
- The number in the node where the pointer p is pointing is equal to 17 and q is NULL.
What determines the maximum number of executions of the while loop in a binary tree?
What determines the maximum number of executions of the while loop in a binary tree?
- The number being inserted
- The depth of the binary tree (correct)
- The position of the pointer p
- The number of nodes in the binary tree
What happens after the while loop during the insertion process?
What happens after the while loop during the insertion process?
What does the movement of p or q to the left or right side indicate during insertion?
What does the movement of p or q to the left or right side indicate during insertion?