What is the runtime complexity of searching for an item in a binary search tree?

Advertisement

  • The runtime for searching in a binary search tree is O(1) because each node acts as a key, similar to a dictionary.
  • The runtime for searching in a binary search tree is O(n!) because every node must be compared to every other node.
  • The runtime for searching in a binary search tree is generally O(h), where h is the height of the tree.
  • The runtime for searching in a binary search tree is O(n) because every node in the tree must be visited.
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment


Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend