ࡱ> 45  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Root Entryb.@p(ySlideShow(y(yMain [PerfectOffice_MAIN&2[ [S Original Slide ShowZOh+'Oh+'0 H ` l Rob Hochberg~3c:\Corel\Suite8\Programs\Masters\Color\DEFAULT.MST       !"#$%&'()*+,-./0123WPC2[ ~ m { n   H=CTZp|"XXXX'3XXXX3' >dm&y {,?WPC "@ "2  I  .3  ComplexityofBinarySearch##2  I  .3  ComplexityofBinarySearch..2  A  .3  Calculatethenumberoftimesthewhileloopwillbeexecuted..2  A  .3  Eachpassthroughthewhileloopdecreasesthesizeoftherangebyatleasthalf..2  A  .3  Sothequestionis:....2  1  .3  Givenanintegern,howmanytimesdoesitneedtobecutinhalfbeforeitreaches,orgoesbelow,1?..2  A  .3  Thatis,whichofthefollowingwillfirstbe<1?....2  1  .3  n/2,n/4,n/8,n/16,...,n/2k,...##2  I  .3  ComplexityofBinarySearch..2  A  .3  Thatis,whichofthefollowingwillfirstbe<1?....2  1  .3  n/2,n/4,n/8,n/16,...,n/2k,.....2  A  .3  Wesolvetheequation:n/2k<1,andgetk>log2n..2  A  .3  Soifwesetk=Ilog2nJ,thenweknowthatafterthatmanyiterationsofthewhileloop,wewillhavefoundouritem,orconcludedthatitwasnotinthelist' '2  I  .3  LogarithmicTimeComplexityisFast..2  A  .3  Ouranalysisshowsthatbinarysearchcanbedoneintimeproportionaltothelogofthenumberofitemsinthelist..2  A  .3  Thisisconsideredveryfastwhencomparedtolinearorpolynomialalgorithms..2  A  .3  Thetabletotherightcomparesthenumberofoperationsthatneedtobeperformedforalgorithmsofvarioustimecomplexities((2  I  .3  AnAlgorithmtoTestone-to-one-ness..2  A  .3  TESTPAIRS:..2  A  .3  Supposef:ABisafunction,andAandBarefinitesets..2  A  .3  ForeachelementaofA,computeb=f(a),andthencheck,foreachelementa-A,a-ca,whetherf(a-)=b.....2  1  .3  Infinitetimewewillcheckallpairs....2  1  .3  Eachcheckingisastraightforwardcomparison....2  1  .3  Iftheanswerisever yes,thenthefunctionisnot1-1....2  1  .3  Otherwisethefunctionis1-1..2  A  .3  Arentyouwonderingwhatthetimecomplexityofthisalgorithmis?(  (2  I  .3  TimeComplexityofTESTPAIRS..2  A  .3  Wehavetoconsider|A|elements..2  A  .3  Foreachofthose,weneedtocompareitsfunctionvaluewiththatof|A|!1otherelements..2  A  .3  Foratotaltimeof|A|(|A|!1)steps..2  A  .3  WhichisO(|A|2)....2  1  .3  ThisisconsideredaquadraticalgorithminthesizeofA....2  1  .3  NotethatthesizeofBdoesnotaffectthespeedofthealgorithm..2  A  .3  Canwedobetter?Canyousuggestanotheralgorithm?(  (2  I  .3  AnotherAlgorithmtoTest1-1..2  A  .3  COLORRANGE:..2  A  .3  ForeachelementaofA,colorf(a)bluetoshowthat wevebeentherealready..2  A  .3  If,duringthisprocess,wetrytocoloranelementbluewhichisalreadyblue,thenthefunctionisnot1-1...2  A  .3  Butifthatneverhappens,thenthefunctionis1-1..2  A  .3  Again,Icanseethatyouarewonderingwhatthetimecomplexityofthisalgorithmis...( (2  I  .3  ComplexityofCOLORRANGE..2  A  .3  WedosomethingonceforeachelementofA,andthatsomethingtakesconstanttime..2  A  .3  Inthe worstcase,thatis,thecasethatmakesouralgorithmrunthelongest,wehavetoscanthroughallofA,whichwilltake|A|steps...2  A  .3  SoouralgorithmwillruninO(|A|)steps.....2  1  .3  SoouralgorithmislinearinthesizeofA....2  1  .3  Noteagainthat|B|doesnotaffecttherunningtime....2  1  .3  IsthisfasterorslowerthanTESTPAIRS? ^(q <G W*$8L`"=НQBackground BlankBackground 3Background 4 TitleBulleted ListTextOrg ChartData ChartCombinationWPCT}C:P\\TIN-3'XXXXKKKK5/ @1 'Q; ? ///333???OOO___fffooof1?O/_??ߟ߿c3f3&f3?LU`l w#'*-/257:=T bjs({3=GQ[s3&?1L; UFaQl[xfp{#',04̳9׿Q.V5b;lAvGLT ` h o rux|(-8DOZfq|3fH uUb#p/:EP\fuɒџزf3uPYcl v  *D_yf(u/5;AG L R X ^!l4zH[ofu    1%MAj^z=.O;`LrVcp̙ܥ$DYނB(#G-)L20P76U<=ZAC_FJdLPiQWmV]r[cw`j|epjwo}tufp{lws}yź3">)L3$U8*`@/lG5wO:V@^EoZn̲9WPCXX81%l 3'XXXXLLxx5139_JWPCXX81%A-3'XXXXLLxx5139_JWPC8XX81%X0%$3'XXXXLLxx5139 #X0%153**`!?'u[/;~s%+%+s+153**`"`l\M&2&2BBWPC XX81%)/#x3'XXXXLLxx ? ///333???OOO___fffooof1?O/_??ߟ߿c3f3&f3?LU`l w#'*-/257:=T bjs({3=GQ[s3&?1L; UFaQl[xfp{#',04̳9׿Q.V5b;lAvGLT ` h o rux|(-8DOZfq|3fH uUb#p/:EP\fuɒџزf3uPYcl v  *D_yf(u/5;AG L R X ^!l4zH[ofu    1%MAj^z=.O;`LrVcp̙ܥ$DYނB(#G-)L20P76U<=ZAC_FJdLPiQWmV]r[cw`j|epjwo}tufp{lws}yź3">)L3$U8*`@/lG5wO:V@^EoZn̲9_J"Ws.0 .0 W ` ` &d9 Z6Times New Roman Regular -O;@YW ` ` &d9 Z6Times New Roman Regular -O;@YW ` ` &d9 Z6Times New Roman Regular -O;@YW ` ` &d9 Z6Times New Roman Regular -O;@YW ` ` &d9 Z6Times New Roman Regular -O;@YW ` ` &d9 Z6Times New Roman Regular -O;@Y)?  9׿aQ 4 @ @ @ @ @ @ f" dddddd$ =2  I  .3  TitleofShow  W.0 .%O;3Y v/c&d9 Z6Times New Roman Regularc` ` `      O;   @Y  Q Qc&d9 Z6Times New Roman Regularc` ` `  TitleofShow.+%19׿3aQ `w.0.0??WPC&$XX81%n/"3'XXXXLLxx ? ///333???OOO___fffooof1?O/_??ߟ߿c3f3&f3?LU`l w#'*-/257:=T bjs({3=GQ[s3&?1L; UFaQl[xfp{#',04̳9׿Q.V5b;lAvGLT ` h o rux|(-8DOZfq|3fH uUb#p/:EP\fuɒџزf3uPYcl v  *D_yf(u/5;AG L R X ^!l4zH[ofu    1%MAj^z=.O;`LrVcp̙ܥ$DYނB(#G-)L20P76U<=ZAC_FJdLPiQWmV]r[cw`j|epjwo}tufp{lws}yź3">)L3$U8*`@/lG5wO:V@^EoZn̲9_"u/"u/"W @@&d9 Z6Times New Roman Regular +ނW xx&d9 Z6Times New Roman Regular +#O ?a 9Z+.Courier New Regular +#W &d9 Z6Times New Roman Regular +pP#W &d9 Z6Times New Roman Regular +#W &d9 Z6Times New Roman Regular +#9/!!!!!!  Z9׿aQ 4 @ @ @ @ @ @ L" dddddd$ X2  I  .3  FirstItem2  A  .3  Subitem2  I  .3  SecondItem2  A  .3  Subitem2  I  .3  ThirdItem2  I  .3  FourthItem  u/".1 +:/c&d9 Z6Times New Roman Regularc        @a /!!!!!!ac&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..FirstItemc&d9 Z6Times New Roman Regularcxxx        @#M..M        @    c&d9 Z6Times New Roman Regularcxxx        @#0..SubitemLc&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..SecondItemc&d9 Z6Times New Roman Regularcxxx        @#M..M        @    c&d9 Z6Times New Roman Regularcxxx        @#0..SubitemLc&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..ThirdItemLc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..FourthItem.1"2+R/#R/#W &d9 Z6Times New Roman Regular -`L@YW &d9 Z6Times New Roman Regular -`L@YW &d9 Z6Times New Roman Regular -`L@YW &d9 Z6Times New Roman Regular -`L@YW &d9 Z6Times New Roman Regular -`L@YW &d9 Z6Times New Roman Regular -`L@Y)?  9׿aQ 4 @ @ @ @ @ @ f" dddddd$ >2  I  .3  TitleofSlide  R/#%`L3Y A / #c&d9 Z6Times New Roman Regularc     `L   @Y  Q Q c&d9 Z6Times New Roman RegularcTitleofSlide.+%19׿3aQ `R//RWPCXX81%/"3'XXXXLLxx ? ///333???OOO___fffooof1?O/_??ߟ߿c3f3&f3?LU`l w#'*-/257:=T bjs({3=GQ[s3&?1L; UFaQl[xfp{#',04̳9׿Q.V5b;lAvGLT ` h o rux|(-8DOZfq|3fH uUb#p/:EP\fuɒџزf3uPYcl v  *D_yf(u/5;AG L R X ^!l4zH[ofu    1%MAj^z=.O;`LrVcp̙ܥ$DYނB(#G-)L20P76U<=ZAC_FJdLPiQWmV]r[cw`j|epjwo}tufp{lws}yź3">)L3$U8*`@/lG5wO:V@^EoZn̲9_"uE/"uE/"W @@&d9 Z6Times New Roman Regular -@YW xx&d9 Z6Times New Roman Regular -@YW &d9 Z6Times New Roman Regular -@YW &d9 Z6Times New Roman Regular -@YW &d9 Z6Times New Roman Regular -@YW &d9 Z6Times New Roman Regular -@Y)?  Z9׿aQ 4 @ @ @ @ @ @ f" dddddd$ 2  I  .3  Thisisthefirstitem.Thisistheseconditem.Thisisthethirditem.Thisisthefourthitem.  uE/".%3Y +E:/6c&d9 Z6Times New Roman Regularc        @Y  Q Qc&d9 Z6Times New Roman Regularc@@@Thisisthefirstitem.Thisistheseconditem.Thisisthethirditem.Thisisthefourthitem..%3"2.R/#R/#W &d9 Z6Times New Roman Regular -`L@YW &d9 Z6Times New Roman Regular -`L@YW &d9 Z6Times New Roman Regular -`L@YW &d9 Z6Times New Roman Regular -`L@YW &d9 Z6Times New Roman Regular -`L@YW &d9 Z6Times New Roman Regular -`L@Y)?  9׿aQ 4 @ @ @ @ @ @ f" dddddd$ >2  I  .3  TitleofSlide  R/#.%`L3Y $ / #c&d9 Z6Times New Roman Regularc     `L   @Y  Q Qc&d9 Z6Times New Roman Regularc TitleofSlide.+%19׿3aQ `R//RWPCXX81%T/"ʎ3'XXXXLLxx ? ///333???OOO___fffooof1?O/_??ߟ߿c3f3&f3?LU`l w#'*-/257:=T bjs({3=GQ[s3&?1L; UFaQl[xfp{#',04̳9׿Q.V5b;lAvGLT ` h o rux|(-8DOZfq|3fH uUb#p/:EP\fuɒџزf3uPYcl v  *D_yf(u/5;AG L R X ^!l4zH[ofu    1%MAj^z=.O;`LrVcp̙ܥ$DYނB(#G-)L20P76U<=ZAC_FJdLPiQWmV]r[cw`j|epjwo}tufp{lws}yź3">)L3$U8*`@/lG5wO:V@^EoZn̲9_"ߌA/.#CA"Arial Regular #@  @K  2  I  .3  PR7OrgChart@-/< Name >< Title >       ! $     # L; L; $ $      $      $ $ $ $      $      $ $ $      $      $ $ $      $      $ $ $      $      $ $ $ $      $      $ $ $      $      $ $ $      $      $ $ $      $      $A                                        % ߌ/-% ss  $ $  s $ / /   $ $  * *   $ $  / * -+1#3L; 'f-f- '  !f&f& !  =f! f!  =  ! & &!-+13    s s  ŽQ Q  Îs s  Ď Q -+1#3L; Ŏ_fCfC _  Ǝ fefe   ǎf f    Ȏ e e  Ɏdd+%13"20R/#jR/#C \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LY)?  @9׿aQ 4 f>2  I  .3  TitleofSlide  R/#+%`L13Y 2 /#9O, \AZ"Arial RegularO        @  Q QO, \AZ"Arial RegularO     `L   @Y TitleofSlide+%19׿3aQ `R//RWPC=XX81%/"i3'XXXXLLxx ? ///333???OOO___fffooof1?O/_??ߟ߿c3f3&f3?LU`l w#'*-/257:=T bjs({3=GQ[s3&?1L; UFaQl[xfp{#',04̳9׿Q.V5b;lAvGLT ` h o rux|(-8DOZfq|3fH uUb#p/:EP\fuɒџزf3uPYcl v  *D_yf(u/5;AG L R X ^!l4zH[ofu    1%MAj^z=.O;`LrVcp̙ܥ$DYނB(#G-)L20P76U<=ZAC_FJdLPiQWmV]r[cw`j|epjwo}tufp{lws}yź3">)L3$U8*`@/lG5wO:V@^EoZn̲9_"1p/Bbp/B#?Y@4@#?Y@4@#?@?cc 9@ZM M 9@ZM M   22226ffffffֿp= ף(\?TQ ! 19׿3&  ! 13&  ! 1ɒ3&  ! 1 3&   ! 13&  ! 13&  ! 1wO:3&  ! 1p3&  ! 1   ! 1    ! 1    ! 1    ! 1    ! 1   ! 1  ! 1  ! 1  ! 1  ! 1?  ! 1  ! 1  ! 1  ! 1  ! 1  43&>1J; UF`Ql[wfq{#l[C ` ` , \AZ"Arial Regular +3&  1#aQC , \AZ"Arial Regular +3&  1#aQC ee, \AZ"Arial Regular +DD  1C ee, \AZ"Arial Regular +DD  1C ee, \AZ"Arial Regular +DD  1C ee, \AZ"Arial Regular +$$  1C , \AZ"Arial Regular +  1Z# UFC , \AZ"Arial Regular +  1C , \AZ"Arial Regular +  1C ee, \AZ"Arial Regular +   1  C , \AZ"Arial Regular +   1  C , \AZ"Arial Regular +    1 Z9׿l[ C , \AZ"Arial Regular +    1  C , \AZ"Arial Regular - @   3 @  ; // ?Title of ChartSubtitleLegendd g@1st Qtr2nd Qtr3rd Qtr4th QtrNorth# Z2AU@South# 2(-F@East# (@West# - q 1p/B.%'/ Z@1 M 3M  cc   //   c / U)+13  cb c/c  c /  c / c /)       A' ) S. a   a  a  ,S S   S  *     ` & $ C c-(+%1k`3 YC . .(Y19׿33&  C YC Y 1,3' Y.(( 1k`3 C   19׿33& C C 1,3'   1k`3 #C $ $#19׿33& tC #C #t1,3'  #$I t1k`3 !,C c- c-,$19׿33& "0(C ,C ,$0($1,3' #,$c-)0($ $ 1Q +1@m3 %  J133& &Q  Q 1 `3' 'J& JQ 1@m3 (k @ @k133& )  k k 1 `3' *k@ 1@m3 +(" " "("F133& , (" ("FF1 `3' -("F"F1@m3 .* + +*y133& /& * *y&y1 `3' 0*y+['&y $ > *B1dIv3 2 # V  1ɒ33& 3   1n3' 4 V | V 1dIv3 5 #   1ɒ33& 6c   c 1n3' 7  8 c 1dIv3 8~ S!# S!B~ 1ɒ33& 9  ~ ~  1n3' :~ S!BB 1dIv3 ;:) *# * :)R 1ɒ33& <$ :) :)R $R 1n3' =:)R * % $R  $ K e(&1]@3 ?[  0c 0 [ K 1 33& @ [  [ K K 1 `3' A[ K 0 K 1]@3 B c   1 33& C    1 `3' D    1]@3 E c :  1 33& Fv   v 1 `3' G : K: v 1]@3 H' e(c e(&'1 33& I2# ' '2#1 `3' J'e(&$&2#+%13 L  1.13 M g O, \AZ"Arial RegularO        @  1stQtr.13 N~~1.13 OLO, \AZ"Arial RegularO        @  2ndQtr.13 P::1.13 QO, \AZ"Arial RegularO        @  3rdQtr.13 R$$1.13 SH#&O, \AZ"Arial RegularO        @  4thQtr.13 Tc.13 U(oB O, \AZ"Arial RegularO        @  0.13 Vcb b .13 W2 o O, \AZ"Arial RegularO        @  20.13 Xc  .13 Y2G oaO, \AZ"Arial RegularO        @  40.13 Zc.13 [2oO, \AZ"Arial RegularO        @  60.13 \c.13 ]2eoO, \AZ"Arial RegularO        @  80.13 ^c.13 _oO, \AZ"Arial RegularO        @  100 0 h 'W.+%19׿33& `  W6 W6 .+%13 a{ V#O, \AZ"Arial RegularO        @North.+%133& b]]WW.+%13 c #O, \AZ"Arial RegularO        @South.+%1ɒ33& dWW.+%13 eS . #O, \AZ"Arial RegularO        @East.+%1 33& f5"5"Wz#Wz#.+%13 g$ '#O, \AZ"Arial RegularO        @West+%'1"%2/R/#jR/#C \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LY)?  @9׿aQ 4 f>2  I  .3  TitleofSlide  %R/#+%`L13Y #2 /#9O, \AZ"Arial RegularO        @  Q QO, \AZ"Arial RegularO     `L   @Y TitleofSlide.+%19׿3aQ `$R//RWPCQXX81% /"͐3'XXXXLLxx ? ///333???OOO___fffooof1?O/_??ߟ߿c3f3&f3?LU`l w#'*-/257:=T bjs({3=GQ[s3&?1L; UFaQl[xfp{#',04̳9׿Q.V5b;lAvGLT ` h o rux|(-8DOZfq|3fH uUb#p/:EP\fuɒџزf3uPYcl v  *D_yf(u/5;AG L R X ^!l4zH[ofu    1%MAj^z=.O;`LrVcp̙ܥ$DYނB(#G-)L20P76U<=ZAC_FJdLPiQWmV]r[cw`j|epjwo}tufp{lws}yź3">)L3$U8*`@/lG5wO:V@^EoZn̲9_"2/R/#jR/#C \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LYC \AZ"Arial Regular +`LY)?  @9׿aQ 4 f>2  I  .3  TitleofSlide  R/#+%`L13Y 2 /#9O, \AZ"Arial RegularO        @  Q QO, \AZ"Arial RegularO     `L   @Y TitleofSlide+%19׿3aQ `R//R+13"^ 6` C  \AZ"Arial Regular -@YC  \AZ"Arial Regular +#C RR \AZ"Arial Regular +#C RR \AZ"Arial Regular +#C RR \AZ"Arial Regular +#C RR \AZ"Arial Regular +#9/!!!!!!  9׿aQ 4 @ @ @ @ @ @ f" ddddddX2  I  .3  FirstItem2  A  .3  Subitem2  I  .3  SecondItem2  A  .3  Subitem2  I  .3  ThirdItem2  I  .3  FourthItem  ^ +1 k^ 3O, \AZ"Arial RegularORRR        @  a /!!!!!!aO, \AZ"Arial RegularO        @  /O, \AZ"Arial RegularO        @Y0..FirstItemO, \AZ"Arial RegularO        @#..        @O, \AZ"Arial RegularO        @#06..SubitemfO, \AZ"Arial RegularO        @/O, \AZ"Arial RegularO        @Y0..SecondItemO, \AZ"Arial RegularO        @#..        @O, \AZ"Arial RegularO        @#06..SubitemfO, \AZ"Arial RegularO        @/O, \AZ"Arial RegularO        @Y0..ThirdItemfO, \AZ"Arial RegularO        @/O, \AZ"Arial RegularO        @Y0..FourthItem+1"|x^/b^/#?Y@4@#?Y@4@#?@?cc 9@ZM M 9@ZM M   22226ffffffֿp= ף(\?TQ ! 19׿3&  ! 13&  ! 1ɒ3&  ! 1 3&   ! 13&  ! 13&  ! 1wO:3&  ! 1p3&  ! 1   ! 1    ! 1    ! 1    ! 1    ! 1   ! 1  ! 1  ! 1  ! 1  ! 1?  ! 1  ! 1  ! 1  ! 1  ! 1  43&>1J; UF`Ql[wfq{#l[C ` ` , \AZ"Arial Regular +3&  1#aQC , \AZ"Arial Regular +3&  1#aQC ee, \AZ"Arial Regular +DD  1C ee, \AZ"Arial Regular +DD  1C ee, \AZ"Arial Regular +DD  1C ee, \AZ"Arial Regular +$$  1C , \AZ"Arial Regular +  1Z# UFC , \AZ"Arial Regular +  1C , \AZ"Arial Regular +  1C ee, \AZ"Arial Regular +   1  C , \AZ"Arial Regular +   1  C , \AZ"Arial Regular +    1 Z9׿l[ C , \AZ"Arial Regular +    1  C , \AZ"Arial Regular - @   3 @   // ?Title of ChartSubtitleLegendd 1@1st Qtr2nd Qtr3rd Qtr4th QtrNorth# Z2AU@South# 2(-F@East# (@West# - q |^/.%'/ Z@1 M 3M l"G " n  m"G "//G  n "G /G b- +13 o "h/h p "/ q +"/ r M"/) s\# %G  t& ?)G  u * ,G ) vK/ !  w! !M x. K!  yK! K! z.h h  { h  & " .+%1k`3 |$ $ $$e19׿33& }" $ $e"e1,3' ~$e$>#"e1k`3 ' A( A(r'"19׿33& D& ' '"D&"1,3' '"A(r&rD&"1k`3 G+ + + G+19׿33& ) G+ G+)1,3' G++ ) )1k`3 . . .,.19׿33& , . .,1,3' ..,D-,, $ I"0 M.1@m3 #0 G$ G$#133& I"0 #0 #I"1 `3' #G$"I"1@m3 L'0 ' 'L'r133& %0 L'0 L'r%r1 `3' L'r'%%r1@m3 *0 * *J*133& (0 *0 *(1 `3' **JJ)J(1@m3 -0 M. M.-133& O,0 -0 -O,1 `3' -M.,O, $ ! -"1dIv3 R# # # R#9 1ɒ33& ! R# R#9 !9 1n3' R#9 # ! !9 1dIv3 & & && 1ɒ33& $ & & $ 1n3' & &O%$ 1dIv3 * R* R*"*1ɒ33& U( * *U(1n3' *R*"("U(1dIv3 X- - - X- 1ɒ33& + X- X- + 1n3' X- - + +  $ ! - 1]@3 " #@ #P " 1 33& ! " " ! 1 `3' " #P U!P ! 1]@3 & X&@ X&a & 1 33& [$ & & [$ 1 `3' & X&a $a [$ 1]@3 ^) )@ )r ^)" 1 33& ' ^) ^)" '" 1 `3' ^)" )r (r '" 1]@3 , -@ - ,1 33&  + , , +1 `3' ,- [+  ++%13 ! !, .13 # >#O, \AZ"Arial RegularO        @  1stQtr.13 % %, .13 S#&O, \AZ"Arial RegularO        @  2ndQtr.13 _( _(, .13 &)O, \AZ"Arial RegularO        @  3rdQtr.13 + +, .13 !*L-O, \AZ"Arial RegularO        @  4thQtr.13  i .13 }% 4 O, \AZ"Arial RegularO        @  0.13  i .13 F U O, \AZ"Arial RegularO        @  20.13  i .13 g vO, \AZ"Arial RegularO        @  40.13  +i+.13 O, \AZ"Arial RegularO        @  60.13  MiM.13 O, \AZ"Arial RegularO        @  80.13  nin.13 Ð^O, \AZ"Arial RegularO        @  100 0 ̐ ,n.+%19׿33& Đ 6 n!n!6.+%13 Ő*#/%>O, \AZ"Arial RegularO        @North.+%133& Ɛt'6t'n(n(6.+%13 ǐ)/,>O, \AZ"Arial RegularO        @South.+%1ɒ33& Ȑ  !!.+%13 ɐ*#%O, \AZ"Arial RegularO        @East.+%1 33& ʐt't'((.+%13 ː),O, \AZ"Arial RegularO        @West&7I[6~^? l(5;tCS[xր/բR'|WPCXX81%XX81%ą3'XXXXLLxx9("2*R/#R/#W &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LY)?  9׿aQ 4 @ @ @ @ @ @ f" dddddd$   R/#*+%`L'13Y e6 / #c&d9 Z6Times New Roman Regularc     `L   @Y  Q Qc&d9 Z6Times New Roman Regularc ComplexityofBinarySearch.+%19׿3aQ `fR// R WPC=XX81%XX81%3'XXXXLLxx9("z? / "z? / "W @@&d9 Z6Times New Roman Regular +ނW xx&d9 Z6Times New Roman Regular +#O ?a 9Z+.Courier New Regular +#W &d9 Z6Times New Roman Regular +pP#W &d9 Z6Times New Roman Regular +#W &d9 Z6Times New Roman Regular +#9/!!!!!!  Z9׿aQ 4 @ @ @ @ @ @ L" dddddd$   z? / "-.*+%'13 0? 5/!zc&d9 Z6Times New Roman Regularc        @a /!!!!!!ac&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..CalculatethenumberoftimesthewhileloopwillbeexecutedLc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..EachpassthroughthewhileloopdecreasesthesizeoftherangebyatleasthalfLc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Sothequestionis:c&d9 Z6Times New Roman Regularcxxx        @#M..M        @    c&d9 Z6Times New Roman Regularcxxx        @#0..Givenanintegern,howmanytimesdoesitneedtobecutinhalfbeforeitreaches,orgoesbelow,1?Lc&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Thatis,whichofthefollowingwillfirstbe<1?c&d9 Z6Times New Roman Regularcxxx        @#M..M        @    c&d9 Z6Times New Roman Regularcxxx        @#0..n/2,n/4,n/8,n/16,...,n/2k,...WPCXX81%XX81%3'XXXXLLxx9("2*R/#R/#W &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LY)?  9׿aQ 4 @ @ @ @ @ @ f" dddddd$   R/#.%`L13Y e6 / #c&d9 Z6Times New Roman Regularc     `L   @Y  Q Qc&d9 Z6Times New Roman Regularc ComplexityofBinarySearch.+%19׿3aQ `fR// R WPC3XX81%XX81%3'XXXXLLxx9("u/"u/"W @@&d9 Z6Times New Roman Regular +ނW xx&d9 Z6Times New Roman Regular +#O ?a 9Z+.Courier New Regular +#W &d9 Z6Times New Roman Regular +pP#W &d9 Z6Times New Roman Regular +#W &d9 Z6Times New Roman Regular +#9/!!!!!!  Z9׿aQ 4 @ @ @ @ @ @ L" dddddd$   u/"-.)*+%'13 e+:/l c&d9 Z6Times New Roman Regularc        @a /!!!!!!ac&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Thatis,whichofthefollowingwillfirstbe<1?c&d9 Z6Times New Roman Regularcxxx        @#M..M        @    c&d9 Z6Times New Roman Regularcxxx        @#0..n/2,n/4,n/8,n/16,...,n/2k,...Lc&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Wesolvetheequation:n/2k<1,andgetk>log2nLc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Soifwesetk=Ilog2nJ,thenweknowthatafterthatmanyiterationsofthewhileloop,wewillhavefoundouritem,orconcludedthatitwasnotinthelistWPCXX81%XX81%3'XXXXLLxx9("2*R/#R/#W &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LY)?  9׿aQ 4 @ @ @ @ @ @ f" dddddd$   R/#.%`L13Y 6 / #c&d9 Z6Times New Roman Regularc     `L   @Y  Q Qc&d9 Z6Times New Roman Regularc ComplexityofBinarySearch.+%19׿3aQ `R// R WPCXX81%XX81%3'XXXXLLxx9\A( ,T,TW xx&d9 Z6Times New Roman Regular +ނW &d9 Z6Times New Roman Regular +#O ?a 9Z+.Courier New Regular +#W kk&d9 Z6Times New Roman Regular +pP#W kk&d9 Z6Times New Roman Regular +#W kk&d9 Z6Times New Roman Regular +#9/!!!!!!  Z9׿aQ 4 @ @ @ @ @ @ L" dddddd$   ,T-.)*+%'153 :,r c&d9 Z6Times New Roman Regularckkk        @a /!!!!!!ac&d9 Z6Times New Roman Regularcxxx        @ނ        @  /  c&d9 Z6Times New Roman Regularcxxx        @ނ0$..OuranalysisshowsthatbinarysearchcanbedoneintimeproportionaltothelogofthenumberofitemsinthelistLc&d9 Z6Times New Roman Regularcxxx        @  /  c&d9 Z6Times New Roman Regularcxxx        @ނ0$..ThisisconsideredveryfastwhencomparedtolinearorpolynomialalgorithmsLc&d9 Z6Times New Roman Regularcxxx        @  /  c&d9 Z6Times New Roman Regularcxxx        @ނ0$..ThetabletotherightcomparesthenumberofoperationsthatneedtobeperformedforalgorithmsofvarioustimecomplexitiesWPCXX81%XX81%Å3'XXXXLLxx9j"2)R/#R/#W &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LY)?  9׿aQ 4 @ @ @ @ @ @ f" dddddd$   R/#.)*+%`L'13Y $ / #c&d9 Z6Times New Roman Regularc     `L   @Y  Q Qc&d9 Z6Times New Roman Regularc LogarithmicTimeComplexityis     `L   @YFast     `L   @Y.+%19׿3aQ `…R//RWPCXX81%XX81%3'XXXXLLxx9j"u0u0W @@&d9 Z6Times New Roman Regular +ނW xx&d9 Z6Times New Roman Regular +#O ?a 9Z+.Courier New Regular +#W &d9 Z6Times New Roman Regular +pP#W &d9 Z6Times New Roman Regular +#W &d9 Z6Times New Roman Regular +#9/!!!!!!  Z9׿aQ 4 @ @ @ @ @ @ L" dddddd$   u0.)*+%'153 +/*6c&d9 Z6Times New Roman Regularc        @a /!!!!!!ac&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..TESTPAIRS:Lc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Supposef:ABisafunction,andAandBarefinitesetsLc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..ForeachelementaofA,computeb=f(a),andthencheck,foreachelementa-A,a-ca,whetherf(a-)=b.c&d9 Z6Times New Roman Regularcxxx        @#M..M        @    c&d9 Z6Times New Roman Regularcxxx        @#0..InfinitetimewewillcheckallpairsM..Mc&d9 Z6Times New Roman Regularcxxx        @    c&d9 Z6Times New Roman Regularcxxx        @#0..EachcheckingisastraightforwardcomparisonM..Mc&d9 Z6Times New Roman Regularcxxx        @    c&d9 Z6Times New Roman Regularcxxx        @#0..Iftheanswerisever yes,thenthefunctionisnot1-1M..Mc&d9 Z6Times New Roman Regularcxxx        @    c&d9 Z6Times New Roman Regularcxxx        @#0..Otherwisethefunctionis1-1Lc&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Arentyouwonderingwhatthetimecomplexityofthisalgorithmis?WPCXX81%XX81%3'XXXXLLxx9j"2R/#R/#W &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LY)?  9׿aQ 4 @ @ @ @ @ @ f" dddddd$   R/#.%`L13Y $ / #c&d9 Z6Times New Roman Regularc     `L   @Y  Q Qc&d9 Z6Times New Roman Regularc AnAlgorithmtoTestone-to-one-ness.+%19׿3aQ `R//RWPCXX81%XX81%3'XXXXLLxx9 j"2*R/#R/#W &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LY)?  9׿aQ 4 @ @ @ @ @ @ f" dddddd$   R/#.%`L13Y e$ / #c&d9 Z6Times New Roman Regularc     `L   @Y  Q Qc&d9 Z6Times New Roman Regularc TimeComplexityofTESTPAIRS.+%19׿3aQ `fR//RWPC-XX81%XX81%3'XXXXLLxx9 j"$u0u0W @@&d9 Z6Times New Roman Regular +ނW xx&d9 Z6Times New Roman Regular +#O ?a 9Z+.Courier New Regular +#W &d9 Z6Times New Roman Regular +pP#W &d9 Z6Times New Roman Regular +#W &d9 Z6Times New Roman Regular +#9/!!!!!!  Z9׿aQ 4 @ @ @ @ @ @ L" dddddd$   u0-.)*+%'153 +:06^c&d9 Z6Times New Roman Regularc        @a /!!!!!!ac&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Wehavetoconsider|A|elementsLc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Foreachofthose,weneedtocompareitsfunctionvaluewiththatof|A|!1otherelementsLc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Foratotaltimeof|A|(|A|!1)stepsLc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..WhichisO(|A|2)c&d9 Z6Times New Roman Regularcxxx        @#M..M        @    c&d9 Z6Times New Roman Regularcxxx        @#0..ThisisconsideredaquadraticalgorithminthesizeofAM..Mc&d9 Z6Times New Roman Regularcxxx        @    c&d9 Z6Times New Roman Regularcxxx        @#0..NotethatthesizeofBdoesnotaffectthespeedofthealgorithmM..MLc&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Canwedobetter?Canyousuggestanotheralgorithm?WPCPXX81%XX81%3'XXXXLLxx9j"u/Bu/BW @@&d9 Z6Times New Roman Regular +ނW xx&d9 Z6Times New Roman Regular +#O ?a 9Z+.Courier New Regular +#W &d9 Z6Times New Roman Regular +pP#W &d9 Z6Times New Roman Regular +#W &d9 Z6Times New Roman Regular +#9/!!!!!!  Z9׿aQ 4 @ @ @ @ @ @ L" dddddd$   u/B-.)*+%'153 +8/c&d9 Z6Times New Roman Regularc        @a /!!!!!!ac&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..COLORRANGE:Lc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..ForeachelementaofA,colorf(a)bluetoshowthat wevebeentherealreadyLc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..If,duringthisprocess,wetrytocoloranelementbluewhichisalreadyblue,thenthefunctionisnot1-1.Lc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Butifthatneverhappens,thenthefunctionis1-1Lc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Again,Icanseethatyouarewonderingwhatthetimecomplexityofthisalgorithmis...WPCXX81%XX81%3'XXXXLLxx9j"2*R/#R/#W &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LY)?  9׿aQ 4 @ @ @ @ @ @ f" dddddd$   R/#.%`L13Y e$ / #c&d9 Z6Times New Roman Regularc     `L   @Y  Q Qc&d9 Z6Times New Roman Regularc AnotherAlgorithmtoTest1-1.+%19׿3aQ `fR//RWPCXX81%XX81%3'XXXXLLxx9j"u/"u/"W @@&d9 Z6Times New Roman Regular +ނW xx&d9 Z6Times New Roman Regular +#O ?a 9Z+.Courier New Regular +#W &d9 Z6Times New Roman Regular +pP#W &d9 Z6Times New Roman Regular +#W &d9 Z6Times New Roman Regular +#9/!!!!!!  Z9׿aQ 4 @ @ @ @ @ @ L" dddddd$   u/"-.*+%'153 +:/c&d9 Z6Times New Roman Regularc        @a /!!!!!!ac&d9 Z6Times New Roman Regularc@@@        @ނ        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..WedosomethingonceforeachelementofA,andthatsomethingtakesconstanttimeLc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..Inthe worstcase,thatis,thecasethatmakesouralgorithmrunthelongest,wehavetoscanthroughallofA,whichwilltake|A|steps.Lc&d9 Z6Times New Roman Regularc@@@        @  /  c&d9 Z6Times New Roman Regularc@@@        @ނ0M..SoouralgorithmwillruninO(|A|)steps.c&d9 Z6Times New Roman Regularcxxx        @#M..M        @    c&d9 Z6Times New Roman Regularcxxx        @#0..SoouralgorithmislinearinthesizeofAM..Mc&d9 Z6Times New Roman Regularcxxx        @    c&d9 Z6Times New Roman Regularcxxx        @#0..Noteagainthat|B|doesnotaffecttherunningtimeM..Mc&d9 Z6Times New Roman Regularcxxx        @    c&d9 Z6Times New Roman Regularcxxx        @#0..IsthisfasterorslowerthanTESTPAIRS?WPCXX81%XX81%3'XXXXLLxx9j"2*R/#R/#W &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LYW &d9 Z6Times New Roman Regular +`LY)?  9׿aQ 4 @ @ @ @ @ @ f" dddddd$   R/#.%`L13Y e$ / #c&d9 Z6Times New Roman Regularc     `L   @Y  Q Qc&d9 Z6Times New Roman Regularc ComplexityofCOLORRANGE.+%19׿3aQ `fR//RRhp_WPCPXX81%a1ą3'XXXXLLxx ? ///333???OOO___fffooof1?O/_??ߟ߿c3f3&f3?LU`l w#'*-/257:=T bjs({3=GQ[s3&?1L; UFaQl[xfp{#',04̳9׿Q.V5b;lAvGLT ` h o rux|(-8DOZfq|3fH uUb#p/:EP\fuɒџزf3uPYcl v  *D_yf(u/5;AG L R X ^!l4zH[ofu    1%MAj^z=.O;`LrVcp̙ܥ$DYނB(#G-)L20P76U<=ZAC_FJdLPiQWmV]r[cw`j|epjwo}tufp{lws}yź3">)L3$U8*`@/lG5wO:V@^EoZn̲9_.%3ނ"`(T 4c&d9 Z6Times New Roman Regularcxxx        @ނ  start=1;L..Lend=n; while (start<end){..middle=(start+end)/2;.. if