: Sn 1,2,3,,n - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

: Sn 1,2,3,,n

Description:

?????? ?????? ???? ?????? ????? ???? ????? ?? ??? ???????? ???? ?? ?? ??????. ... return ( GCD(Low,High mod Low) ) ????? : GCD(24,15) . ??????? ????? ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 8
Provided by: mao5
Category:
Tags: mod

less

Transcript and Presenter's Notes

Title: : Sn 1,2,3,,n


1
???????? ????????
  • ??? ????? ?? ??????? ????? ????? , ?? ?????
    ???????? ???? ?????? ?? .
  • ?????? ?????? ???? ?????? ????? ???? ????? ?? ???
    ???????? ???? ?? ?? ??????. ??? ?? ???? ???
    ?????.
  • ????? ????? Sn ??? ???? ?? ??? ?????? 1,2,3,,n
  • ???????? ??????
  • ??? ????? (???? ????) S1
    1
  • ??? ???????? (???? ?????) Sn n Sn-1

2
???????? ???????? ????
  • ?????
  • S5 5 S4
  • 5 4 S3
  • 5 4 3 S2
  • 5 4 3 2 S1
  • ???? S1 1
  • ????
  • 5 4 3 2 1 15
  • ?????? ???????

3
???????? ???????? ????
  • ???????? ?????? ???? ????? ???? ????? GCD .
  • ?????????
  • GCD ( High , Low )
  • if ( High mod Low 0 )
  • return ( Low )
  • return ( GCD(Low,High mod Low) )
  • ????? GCD(24,15) .

4
??????? ?????
  • ???? ???? ???????? ???????? ?? ????? ?????
  • ?????
  • ???? ???????? ???? ?????? (????? ????) .
  • T(N) T(1) n1
  • 2T(n/2) T(n) ngt1

5
???? ????????? ????? ?????? ?????????? ???
??????? ??????? ??????? .
  • T(n) 2T(n/2) n
  • ???? ????? T(n) nlog n
  • ???? ????? c ???? ????? ????? T(n) cnlog
    n
  • ???? n/2 ???? (T(n/2) lt
    c(n/2)log(n/2
  • T(n) lt 2(c(n/2)log(n/2)) n
  • lt cnlog(n/2) n cnlog(n) -
    cnlog(2) n
  • cnlog(n) - cn n lt cnlog(n)
  • ?????? ???? ?? cgt1 ????? ???? ????? ???? c ?????
    ????.
  • ???? T(1) 1 ???? c1log(1) 0 ???? ?? ??????.
  • ???? n0gt1 ????? ???? ngtn0
  • ????? ???? n2 ?- n3 ????? ngt3 ???? (T(n ??
    ?????? ?-(T(1
  • ???? T(2)4 , T(3)5 ???? ???? T(2)c2log2 ,
    T(3)c3log3
  • ????? ??????? ???? cgt2

6
???? ????? ????
  • ??? ???? ????
  • ????? ?? ?????
    ???? ?????? ????? ?? ???? ?? ?? ?????.
  • ???? ?????? ????? ??? ????? ²n ????
    ????? n
  • ???? ????? ????? ??????
  • ????? ?? ???? log(n)
    m
  • ????? ????? S(m)2S(m/2)
    m ???? ((O(mlog( m
  • ????

7
???? ?????????
  • ???? ????? ????????? ?? ????? ?????? ?? ?????
    ???? ????? ?-n ?????? ?????
  • T(n) 3T(n/4) n n 3T(n/4) n 3((n/4)
    3T(n/16))
  • n 3((n/4) 3((n/16) 3T(n/64)))
  • n 3(n/4) 9(n/16) 27T(n/64)
  • ????? ?- i ????
  • ???? ????? n 1

8
?? ???????
  • ???? ?? ?? ???????? ???? ?????? T(n)
    T(n/3) T(2n/3) n
  • n
  • n/3
    2n/3
  • n/9 2n/9
    2n/9 4n/9
  • n/27 2n/27 2n/27 4n/27 2n/27
    4n/27 4n/27 8n/27
  • ???? ????? ???? ????? (???? ???) n --gt
    (2/3)n --gt ((2/3)k)n
  • n((2/3)k) 1 gt ( ((2k)n)/(3k) ) 1 gt
    k log3/2n
  • ???????
  • nlog3/2n gt O( nlog(n) )
  • n - ???? ???? log3/2n - ???? ?????
Write a Comment
User Comments (0)
About PowerShow.com