2.3.4: searching algorithms

Cards (7)

  • Which searching algorithm requires data to be sorted before starting?
    Binary search
  • Which example shows linear search?
    C
  • Perform a linear search for 9 on the values: 1, 3, 6, 7, 9, 12, 15

    :
  • What is the time complexity of binary search?
    O(log n)
  • Which example shows binary search
    B
  • Perform a binary search for 6 on the values: 1, 3, 6, 7, 9, 12, 15

    :
  • Which searching algorithm has a time complexity of O(n)?
    Linear search