Multiple choice

Which of the following statements is/are true?

  1. The time complexity for searching an element in binary search tree is O(log n).
  2. The time complexity for searching an element in binary tree is O(n).
  3. The time complexity for searching an element in binary tree and binary search tree cannot be determined.

  1. Both 1 and 2

  2. Only 1

  3. Only 2

  4. Only 2 and 3

  5. 1, 2 and 3

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Statements 1 and 2 are true because the time complexity for searching an element in binary search tree is O(log n) and the time complexity for searching an element in binary tree is O(n). Statement 3 is false as time complexity for searching an element in binary tree and binary search tree can be determined.