Nice article on the introduction to Big-O notation. As far as comparing the binary search vs the linear search, I would also point out that the linear search's best case scenario out performs the binary search. In your animation, if we are sequentially searching for 1, then linear search wins. That's the trade off.
In short, Big-O typically deals with worst case scenario.
Nice article on the introduction to Big-O notation. As far as comparing the binary search vs the linear search, I would also point out that the linear search's best case scenario out performs the binary search. In your animation, if we are sequentially searching for 1, then linear search wins. That's the trade off.
In short, Big-O typically deals with worst case scenario.
Cheers,
@memattchung