19. Is divide and conquer the ffaasstteesstt wwaayy,, aallll
tthhee ttiimmee,, ooff sseeaarrcchhiinngg ffoorr aa nnuummbbeerr iinn aa lliisstt
??
11 Linear Search ?
22
33
110000
Binary Search ?
Suppose they are Random
Suppose they are Ordered
Suppose they are mixed-up
28. EExxaammppllee 22
vvooiidd ff (( iinntt xx [[ ]] ,, iinntt aarrrraayySSiizzee ))
{{
iinntt ii ;;
ffoorr (( ii == 00 ;; ii << aarrrraayySSiizzee ;; ii ++++))
xx [[ ii ]] == ii ;;
}}