Algorithm Search⌘K

Sequential and binary search

Problems

  • Search in a sorted array

    Given a sorted array and a key, find an index of the key, or report that the key is not in the array.

    Ω(log n) worstintro

Algorithms

  • Binary search

    Find a key in a sorted array. Compare the key with the middle item, and keep only the half that can hold the key.

    Θ(log n) worst · average10 languagesvisualintro