The height of a binary tree with 'n' nodes is always:
floor(log2(n)) + 1
Cannot be determined from the number of nodes
n/2
log2(n)
What is the process of adding a new node to a binary tree called?
Traversal
Insertion
Searching
Deletion
What is the primary advantage of using a BST over a sorted array for storing data when frequent insertions and deletions are required?
BSTs use less memory.
BSTs are easier to implement.
BSTs handle insertions and deletions more efficiently.
BSTs offer faster search times.
When deleting a node with two children in a BST, which node is typically chosen as its replacement to maintain the BST properties?
The node with the smallest key in the right subtree
The node with the largest key in the left subtree
A new node with the average key of its children
Either of the above options can be used
What are the three main methods for traversing a binary tree?
Preorder, Inorder, Postorder
Linear, Binary, Exponential
Ascending, Descending, Random
Breadth-first, Depth-first, Level-order
In the context of binary trees, what does 'BST' stand for?
Binary Sorted Tree
Balanced Search Tree
Basic Structure Tree
Binary Search Tree
What is the worst-case time complexity for searching for a node in a balanced binary tree?
O(1)
O(n^2)
O(n)
O(log n)
What is the time complexity of inserting a node into a binary search tree in the worst case?
O(n log n)
What is the maximum possible height of a balanced binary tree with 7 nodes?
4
7
3
2
Which of these data structures can be used to efficiently determine if a given binary tree is a valid BST?
Both Queue and Stack
Stack
Heap
Queue