129k views
1 vote
Which one of these statements about binary search trees is true?

a. deleting a node in a bst only requires links to be adjusted; the garbage collector does the rest. cross out
b. in a bst, each parent node always has an even number of child nodes. cross out
c. in a bst, the search is in the order of o(n log( n )). cross out
d. the ordering property of the key values in the binary search tree nodes makes the search of a key value very fast.

User Bporter
by
8.7k points

1 Answer

3 votes

Final answer:

The ordering property of a binary search tree ensures that search operations are efficient, with a typical time complexity of O(log n), contingent on the tree being balanced.

Step-by-step explanation:

The correct statement about binary search trees (BSTs) is: "The ordering property of the key values in the binary search tree nodes makes the search of a key value very fast." In a BST, each node contains a key and two distinguished sub-trees, commonly referred to as the left and right children. The tree is organized in such a way that for each node, all elements in the left sub-tree are less than the node's key, and all elements in the right sub-tree are greater than the node's key. This ordering allows search operations to be very efficient, typically having a time complexity of O(log n), where n is the number of nodes in the tree. However, this efficiency can only be guaranteed if the tree is balanced. In the worst case of an unbalanced tree, the time complexity can degrade to O(n).

User Vsekhar
by
7.9k points