?????(Sequential Search) PowerPoint PPT Presentation

presentation player overlay
1 / 12
About This Presentation
Transcript and Presenter's Notes

Title: ?????(Sequential Search)


1
?????
  • ???????
  • ?????(Sequential Search)
  • ?????(Binary Search)
  • ?????(Interpolation Search)

2
?????????????
  • ???
  • ???????
  • ???????

3
?????
  • ??????,??????????????????????????????????????,????
    ???????????,??????????????????????????
    ??????????,?????
  • 1.????????????,?????????????????
  • 2.???????????,???????????,????????????????

4
?????
  • ??????????,???????????????????????,???????(Static
    Search)?????(Dynamic Search)?
  • ??????????????,????????????????????,??????????????
    ???
  • ?????????????,?????????????????????

5
?????(Sequential Search)
  • ??????????,????????????????????????????,??????????
    ??????,????????????,??????????????????????????????
    ??????,??????????

6
???????
  • ??
  • ?????????????,????????????,???????????,??n???,???
    ???O(n)?
  • ??????,???????????,??(n1)/2????
  • ???????,??????????????????????????????????????

7
?????(Binary Search)
  • ?????????????,??????????????????????????,?????????
    ???,?????????,???????????????,?????????????

8
???????
  • ????????????????????????,???????log2n1?log2(n
    1),??????O(log n)?
  • ???????????,?????????????????
  • ????????????????

9
???????????????
  • ?????
  • ???????????,???????? ?
  • ?????????,??????,??????????????????
  • ?????
  • ?????????????,????????
  • ????????????,?????????????,??????????????

10
?????(Interpolation Search)
  • ?????????????,??????????????????????,?????????????
    ,???????????????????????????????,?????????????????
    ???????????????
  • Midlow (( key - datalow ) / ( datahigh -
    datalow )) ( high - low )

11
????????
  • key??????,datahigh?datalow?????????????????,??
    ????n,??????????
  • 1.????????????1,2,3...n???
  • 2.?low1,highn
  • 3.?lowlthigh?,??????4???5
  • 4.?Midlow (( key - datalow ) / ( datahigh
    -datalow )) ( high - low )
  • 5.
  • ?keyltkeyMid?high?Mid-1??highMid-1
  • ?keykeyMid????????????
  • ?keygtkeyMid?low?Mid1??lowMid1

12
???????
  • 1.????,????????????,???????????,???????,??????????
    ???????????????????????,??????O(log n)?
  • 2.????????????????
Write a Comment
User Comments (0)
About PowerShow.com