Embercode
✕
Time and Space ComplexityQuick quiz

Cases

6 questions. Covers Best, average and worst case.

Questions 1 to 5 of 6

  1. 1. A list holds 50 names. Which search input makes linear search do the most comparisons?
  2. 2. Quicksort with the first item as the pivot is given 8 items that are already in sorted order. How many comparisons does it make?
  3. 3. True or false: if a hash function returns the same number for every key, a lookup costs about as much as a linear search.
  4. 4. True or false: linear search on a list that does not contain the target is as slow as searching for a target at the last position.
  5. 5. Quicksort with the first item as the pivot runs on 400 items that are already sorted. How many comparisons does it make?

    Type a number.

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.