LinkedIn Python Skill Assessment Quiz Answers

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

Latest Update on 25th January, 2022 by Certification Course Answers

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

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

Correct Answer:

  •  The runtime for searching in a binary search tree is generally O(h), where h is the height of the tree.

Latest Updates

No posts found in this category.