???? - ?? C ?? 2 - PowerPoint PPT Presentation

1 / 53
About This Presentation
Title:

???? - ?? C ?? 2

Description:

Title: 1 Author: v5 Last modified by: cv04 Created Date: 7/21/2004 1:42:15 AM Document presentation format: – PowerPoint PPT presentation

Number of Views:50
Avg rating:3.0/5.0
Slides: 54
Provided by: v574
Category:
Tags: radix | tree

less

Transcript and Presenter's Notes

Title: ???? - ?? C ?? 2


1
Chapter 13 ??
  • 13.1 ????
  • 13.2 ????
  • 13.3 ????
  • 13.4 ????
  • 13.5 ????
  • 13.6 ????
  • 13.7 ?????
  • 13.8 ????
  • 13.9 ????

2
Chapter 13 ??
  • ???????????
  • ????(internal sort)
  • ??????????(main memory)?????,????
  • ????(external sort)
  • ??????,????????????,????????,???????????,????

3
Chapter 13 ??
  • ?????????????????,?????????
  • ????(comparative sort)
  • ?????????????(key value)??,????
  • ????(distributive sort)
  • ???????????????,?????

4
Chapter 13 ??
  • ????(file)????(record),???????????????? k(i)
    k(j)??? r(i) ? r(j),????????,r(i) ?? r(j)
    ???????,???? r(i) ?? r(j) ??,??????????(stable)??
    ?,?? r(j) ? r(i) ??,?????????(unstable)???????????
    ????????,???????,??,???????????,?????????

5
13.1 ????
  • ????(bubble sort)???????(interchange sort)?
  • ??????,???????????,??????
  • ???n???????n-1???,??????,?????1,??????,?????????

6
13.1 ????
  • ???5???,???18, 2, 20, 34, 12??????????

7
13.1 ????
  • ?????12, 18, 2, 20, 34,?????????

8
13.1 ????
  • ????????,????????,??????????,?????????????????????
    ?????????????
  • ?????stable,??????????O(n2),???????????

9
13.2 ????
  • ????(selection sort)????????????????????????(?????
    ???),??????????????????????.....,?????

10
13.2 ????
  • ???5???,????18, 2, 20, 34, 12???????,?????
  • ????????????stable,???????????O(n2),???????????

11
13.3 ????
  • ????(insertion sort)??????????????,?????

12
13.3 ????
  • ?j???????????,?????????j4?,??25,???39?45???,??25?
    ?12?????????
  • ?????stable???,???????????O(n2),?????????

13
13.4 ????
  • ????(merge sort)?????????????????,???????????????

14
13.4 ????
  • ???????????,?????????????,???????,?????,?????,????
    ?8???18, 2, 20,34, 12, 32, 6, 16?

15
13.4 ????
  • ????????????????,??????????????????????
  • ?????stable,???????????O(nlog2n) ?????????????????

16
13.5 ????
  • ????(quick sort)?????????(partition exchange
    sorting)????????,?????????????????n?R1, R2, R3,
    ..., Rn,????K1, K2, K3, ..., Kn?

17
13.5 ????
  • ??????????
  • ?????????k1???K?
  • ???? i 2,3,...,n,????ki gt K?
  • ???? j n, n-1, n-2, ..., 2,????kj lt K ?
  • ?iltj ?Ri?Rj??,??R1?Rj???

18
13.5 ????
  • ???????,??????39, 11, 48, 5, 77, 18, 70, 25, 55,
    33,??????????

19
13.5 ????
  • ???39?????????39?,??????39??
  • ?????????????????,????(recursive)?
  • ?????unstable,?????O(n2),?????O(n log2n) ?

20
13.5 ????
  • ??????????

21
13.6 ????
  • ??(heap)??????,????????????????????????????
  • ???heap????????????(heap sort)?
  • ?13-1?(a)??heap???,?(b)???

22
13.6 ????
  • ????13-2??heap?????

23
13.6 ????
  • ???13-2????????
  • ? ??,A10 25 lt A5 67?????
  • A4 5,??????A8 58,?58 gt 5,??A4?A8???

24
13.6 ????
  • A3 80??????A7 62??,?80 gt 62,??????
  • A2 7,?????A5 67,?A2?A5??,??A5??A
    10?????

25
13.6 ????
  • A1 27,??A3 80,?A1?A3??,??A3??A7???
    ??,??????

26
13.6 ????
  • ????????heap?,?1???80??,??80??10?7??,????,????????
    ????,???????????1??
  • ????????????heap??,????????????????

27
13.6 ????
  • ?????????????????,?????1????,????????,????????????
    ???,??????????,?????,??????,????????????,?????(??
    ???????????heap????)?

28
13.6 ????
  • ??a1 80, A2 67, a3 62, A4 58,
    A5 25, A6 18, A7 27, A8 5, A9
    24, a10 7,?i 1?,????A1?A10??,????A10i
    2,?????A9??,????A9,???????i
    1?,??80,??????

29
13.6 ????
30
13.6 ????
  • ?????????67?62,???67????7??,?????????????(??67???
    ????),?????????(???????)?????

31
13.6 ????
  • i 2,?i 1

32
13.6 ????
  • i 3?i 2

33
13.6 ????
  • i 4?i 3

34
13.6 ????
  • i 5?i 4

35
13.6 ????
  • i 6?i 5

36
13.6 ????
  • i 7?i 6

37
13.6 ????
  • i 8?i 7

38
13.6 ????
  • i 9?i 8
  • ?????5,??????
  • ?????????,?????80, 67, 62, 58, 27, 25, 24, 18, 7,
    5

39
13.7 ?????
  • ?????(binary tree sort)?????????????????,?????????
    ,????
  • ???????????
  • ????????????,?????,????????,??????
  • ?????????,???????,??????????????

40
13.7 ?????
41
13.7 ?????
42
13.7 ?????
  • ??????????????(????)???

43
13.8 ????
  • ???9???,???18, 2, 20, 34, 12, 32, 6, 16, 25,
    10?????(shell sort)????
  • ?????????Y (9/2)??,?Y 4,Y????,??1, 5, 9
    ?????2, 6??????3, 7?????4, 8??????
  • ?????????Y,??????????2,?Yi1 Yi/2,???????????1?

44
13.8 ????
  • ???????????,?15,26,37,48 ?
  • ????????,???????????????,?????????,????????????,??
    ????,??????

45
13.8 ????
46
13.9 ????
  • ????(radix sort)???bucket sort?bin sort?
  • ????distribution sort??????????????????????,??????
    ????????
  • ?????stable,????????O(n logr m) ?

47
13.9 ????
  • ????LSD?????,?????????10,?1 ????????????,???????,?
    ??????

48
13.9 ????
49
13.9 ????
  • ?????????,?F(i)??,0 lt i lt r,????????,????
  • ?????,???????????????????,???????????

50
13.9 ????
51
13.9 ????
  • ????????????
  • ????????????????????,????????????

52
13.9 ????
53
13.9 ????
  • ???????????
  • ?????????
Write a Comment
User Comments (0)
About PowerShow.com