searching

Complete

Summary

Concept

Linear search

  • searching through unsorted lists/arrays
  • check every element
  • eliminate 1 element from search space each time

Binary search

  • searching through sorted lists/arrays or binary search trees
  • check if value is larger or smaller than the head node, check the half that the value should be in
  • cut search space in half each time