227k views
2 votes
What type of algorithms have O(log(n)) runtimes?

1 Answer

5 votes

Answer: binary searches, finding the smallest or largest value in a binary search tree, and certain divide and conquer algorithms.

Step-by-step explanation: O(log N) is a common runtime complexity. Examples include binary searches, finding the smallest or largest value in a binary search tree, and certain divide-and-conquer algorithms. If an algorithm is dividing the elements being considered by 2 in each iteration, then it likely has a runtime complexity of O(log N).

User Samvel Siradeghyan
by
7.6k points