Search/Checking algorithms

= an ⚙️ Algorithm that searches/checks e.g. an 🖇 Array (programming)

Types

  • ∃ Existence test: min 1 element matches (→ return on = no match)
  • ∀ Universal test: every element matches (→ return on ≠ match)

List types

  • Unsorted list
    • Linear search (start → end)
  • Sorted list
    • Binary search
      • element_to_check = (minIndex + maxIndex) / 2
      • if (element_to_check != target)(newMinIndex + newMaxIndex) / 2
      • else → found
      • always round off, stops at first finding