State true or false? Binary search tree requires a sorted list Linear search…

2017

State true or false?

  1. Binary search tree requires a sorted list

  2. Linear search will take n^2 comparisons

  1. A.

    True, True

  2. B.

    True, False

  3. C.

    False, True

  4. D.

    False, False

Attempted by 65 students.

Show answer & explanation

Correct answer: D

A binary search tree does not require the input list itself to be sorted. Linear search takes O(n) comparisons, not n^2. Hence both statements are false.

Explore the full course: Coding For Placement