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