A complete binary tree with 'n' nodes will always have a height of:
n/2
floor(log2(n)) + 1
n
log2(n)
What is a common real-world application of binary trees?
Storing sorted data for efficient retrieval
Implementing algorithms like Huffman coding
All of the above
Representing hierarchical relationships, like file systems
What is the time complexity of inserting a node into a binary search tree in the worst case?
O(n)
O(1)
O(n log n)
O(log n)
Nodes that share the same parent are called:
Descendants
Cousins
Siblings
Ancestors
In a binary tree, what is the depth of a node?
The number of nodes at the same level as the node.
The length of the path from the root to that node.
The number of children the node has.
The height of the subtree rooted at that node.
What is the worst-case time complexity for searching for a node in a balanced binary tree?
O(n^2)
In the context of BST insertion, where is a new node with a key smaller than all existing keys typically inserted?
As the left child of the leftmost node
As the right child of the rightmost node
The position depends on the specific implementation
As the new root
What is the maximum possible height of a balanced binary tree with 7 nodes?
4
7
2
3
What is one way to check the validity of a BST during insertion or deletion operations?
Maintaining a separate sorted array to compare with the BST
It's not possible to ensure validity during the operations themselves.
Checking the BST property locally during the insertion or deletion process
Performing a full tree traversal after every operation
If a binary tree is NOT a BST, can we still find a specific element in it?
Yes, but only if the tree is balanced.
Yes, but we would need to use a brute-force search algorithm.
Yes, but it would be less efficient than searching in a BST.
No, searching is only defined for BSTs.