Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

ΠΛΗ30 ΜΑΘΗΜΑ 1.3 (4in1)

6,415 views

Published on

.

Published in: Education
  • Be the first to comment

  • Be the first to like this

ΠΛΗ30 ΜΑΘΗΜΑ 1.3 (4in1)

  1. 1. 30 1: 1.3: ! " # $ % &' $! " # $ % &' $ ! " # $ % " ! " # $ % #$ & '# () *$ *$ + ) )+ ) ) , . ($ " $ () " $ * ' : ! " # $ % " *+ # '* ' ,' ,' (' -.# * $ * /# 0* * ($) *+ 1 2#" ' # ' 3 ' (+* - ( )&* .' $ ($ ($ *+*+ # ' ,' ,' (+* - * ' # ( ( )&* .' $ ($ ($ 1. * # 1. &! " # $ % " 3 * $ &$ &$ , , , , 3 ' # & * ' *# 3# 4 * ' ( 3 # ' . '' *# 3# 4 * ' ( 3 # ' . ' /# 3 '. 5 +& ' # " * $ ( $ f(n) g(n). ( *: - . /- 0 / $ '()*+, ! ' -./ 0 1 0 + '2+ '(3*+, ! ' -./ 1 0 + '4+ 1 0 + '(5*+, ! ' -./ ! ! 1 0 + '(+ '(6*+, ! ' -./ ! 1 0 + '7+ '( *+, ! ' -./ 0 ! 1 0 + '8+
  2. 2. 1. * # 1. 1. ($ 9! " # $ % " ! , ( ' . * f=O(g), ' * ( : f6g. # ($ .* :# ($ .* : * (3 *# '*&* ( * ( *# n0, f(n) * ' ' #( *# " ( ' cg(n) 3 *# c. ))(()( ngOnf = )()(0:0,00 ngcnfcn ⋅≤≤>>∃ 0nn ≥ H ). f(n)=O(g(n)) + 0* « f .)* $ ' /# 3 ' g» 1. * # 1. 1. ($ :! " # $ % " $ + & * $ )# & * ' # (: 11 +* -* * ( : 2n=O(n3) (+* - : 5) * f(n)=2n, g(n)=n3 .3 * n0=1, c=2. 3 22 )()( nn ncgnf ≤ ≤ )&* 3 * n71 2 1 n≤ 1. * # 1. 2. ($ o ;! " # $ % " ! , ( ' . * f= (g), ' * ( : f<g. # ($ .* :# ($ .* : * (3 *# '*&* ( 3 * * " *# c f(n) * ' ' #( *# ( ' cg(n) * ( *# n0 H ). f(n)= (g(n)) + 0* « f .)* $ ' /# 3 ' g» # )"!! n=O(n) ))(()( ngonf = )()(0::0 0 ngcnfnc ⋅<≤∃>∀ 0nn ≥ n=O(n) n8o(n) n=o(n2) n=o(n3) … . . . (+* - * ' +& 3 #. * ' 3 '* 3 * *# c>0. 1. * # 1. 2. ($ o <! " # $ % " $ + & * $ )# & * ' # (: 22 +* -* * ( : 2n= (n2) (+* - : 5 c>0: nc cn cnn ncgnf < < < < /2 2 2 )()( 2 9# #)* * .3 * $ n0 nc </2 c/2
  3. 3. 1. * # 1. 4. ($ =! " # $ % " ! , ( ' . * f= (g), ' * ( : f7g. # ($ .* :# ($ .* : * (3 *# '*&* ( * ( *# n0, f(n) * ' ' *3 & *# " ( ' cg(n) 3 *# c. ))(()( ngnf Ω= 0)()(:0,00 ≥⋅≥>>∃ ngcnfcn 0nn ≥ H ). f(n)= (g(n)) + 0* « f .)* $ /# 3 ' g» 1. * # 1. 4. ($ ! " # $ % " $ + & * $ )# & * ' # (: 33 +* -* * ( : 4n= (logn) (+* - : 5) * f(n)=4n, g(n)=logn .3 * n0=1, c=4. nn ncgnf log44 )()( ≥ ≥ )&* 3 * n71 nn log≥ 1. * # 1. 5. ($ ! " # $ % " ! , ( ' . * f= (g), ' * ( : f>g. # ($ .* :# ($ .* : * (3 *# '*&* ( 3 * * " *# c f(n) * ' ' *3 & *# ( ' cg(n) * ( *# n0 H ). f(n)= (g(n)) + 0* « f .)* $ /# 3 ' g» # )"!! n= (n) ))(()( ngnf ω= 0)()(::0 0 ≥⋅>∃>∀ ngcnfnc 0nn ≥ n= (n) n8 (n) n= (logn) n= (loglogn) … . . . (+* - * ' +& 3 #. * ' 3 '* 3 * *# c>0. 1. * # 1. 5. ($ ! " # $ % " $ + & * $ )# & * ' # (: 44 +* -* * ( : 0.5n2= (n) (+* - : 5 c>0: c n cnn ncgnf 5.0 5.0 )()( 2 > > > > 9# #)* * .3 * $ n0 cn 2> c2
  4. 4. 1. * # 1. 5. ($ ! " # $ % " ! , ( ' . * f= (g), ' * ( f=g. # ($ .* :# ($ .* : * (3 *# '*&* ( * ( *# n0, f(n) /# * ( ' ( ( ' g(n), ( ' " 0* ' ) * *$ *$ *#.$: ))(()( ngnf Θ= )()()(0:0,,0 21210 ngcnfngcccn ≤≤<>>∃ 0nn ≥ H ). f(n)= (g(n)) + 0* « f * ' * ' g» 1. * # 1. 5. ($ &! " # $ % " $ + & * $ )# & * ' # (: 55 +* -* * ( : 4n= (n) (+* - : 5) * f(n)=4n, g(n)=n .3 * n0=1, c1=2. 24 24 )()( 1 ≥ ≥ ≥ nn ngcnf )&* 3 * n71 .3 * n0=1, c2=6. )&* 3 * n71 24 ≥ 64 64 )()( ≤ ≤ ≤ nn ncgnf ' +* - * ( )&* .' $ ($ ($ * -& 2 ' # " * ': 1. * # 2. :# 9! " # $ % " ' # " * ': * )# & * ' ' ) # (, * ' * )#" ( * #" $: '* ,$ .' $ *' ($ ( *& $) #( $ ' =∝+ = Θ=≠ = ∝+→ ))(()(, ))(()(,0 ))(()(,0 )( )( lim ngnf ngonf ngnfc ng nf n ωτετ τετ τετ '* ,$ .' $ *' ($ ( *& $) #( $ ' *-* * ' )&* .' $ ($ ($ * ' : 3 0 * # ' (# ' 3 * . * ' / * ' )&* " () ' ) $ ($ ($ 1. * # 2. :# :! " # $ % " $ + & * $ )# & * ' # (: 66 +* -* * ( : 0.5n2= (n) (+* - : '* ,$ 0.5n2= (n) ∝+=== ∝+→∝+→∝+→ )5.0(lim 5.0 lim )( )( lim 2 n n n ng nf nnn 66 +* -* * ( : 2n=o(3n) (+* - : '* ,$ 2n=o(3n) 0)66.0(lim 3 2 lim 3 2 lim )( )( lim ==== ∝+→∝+→∝+→∝+→ n n n nn n nn ng nf
  5. 5. 1. * # 3. " $ &$ &$ ;! " # $ % " )& ' ( *$ # / '* $ # * $ 3 $ &$ &$:&$: ! : f=g ' (' ' f6g f7g -.# * ( ( ' )&* )&* ! : ' f<g ( * f6g -.# * ( ( ' )&* )&* ))(()( ngOnf =))(()( ngnf Θ= ))(()( ngnf Ω= ))(()( ngnf ο= ))(()( ngOnf = -.# * ( ( ' )&* )&* (!*' )&* ' # / ) ! : ' f>g ( * f7g -.# * ( ( ' )&* )&* (!*' )&* ' # / ) ))(()( ngnf ω= ))(()( ngnf Ω= 1. * # 4. $ &' <! " # $ % " 5 # O(n2): )& ' *-"$:)& ' *-"$: 1=O(n2) n+2=O(n2) logn=O(n2) logn+5loglogn=O(n2) 3n2=O(n2) ' # 3 ( ($ O(n2) * /# 0* ( *$ $ ' # " * $ * ' #( *#*$ " *$ ( ' n2.* ' #( *#*$ " *$ ( ' n2. 9# O(n2) . #* * ' * ' 0* $ &' ' # " * ' ' 3# / * ' ) : * ),$ .)* * # " * ($ * ' ( . )(2 )(1 2 2 nOn nO ∈+ ∈ . " * $ ; '( $ 1 ' ' * 3 * 0* 3 # ' # " * ' f g * , * * < ' )&* ). ' ) & $ f * ' =! " # $ % " * , * * < ' )&* ). ' ) & $ f * ' g. f(n) g(n) o O n2 n3 < < n1.5 n 4logn 8logn 5n2 0.5n2 .). .)* * * * < 1 * , + ( n2=o(n3) 5n2 0.5n2 n3-5n 8logn . " * $ ; '( $ 2 ' ' * 3 * 0* 3 # ' # " * ' f g * , * * " " ' 3 * $ ( $ 3 &$ ! " # $ % " * , * * " " ' 3 * $ ( $ 3 &$ &$ )&* * -& $ f $ g g(n)=5 g(n)=logn g(n)=n2 g(n)=2n g(n)=5n g(n)=nn f(n)=loglogn f(n)=4logn f(n)=n f(n)=2n2 .). 1 * .)* * * / & loglogn= (1) f(n)=2n f(n)=6n5+n f(n)=3n f(n)=n!
  6. 6. . " * $ / # 3" 1 +* -* *, ' ' $ )#" ' ) # & & & ( : ! " # $ % " & ( : )(.6 )3(2.5 )(46.4 )(loglog.3 )(4.2 )log(.1 2 2 22 nn o nn nn nnn nnOn n nn ω= = Θ=+ Ω= Θ=+ = )(.6 nn ω= . " * $ / # 3" 2 +* -* *, ' ' $ )#" # & ' # ' ( : ! " # $ % " )(.6 )3(2.5 )(46.4 )(loglog.3 )(4.2 )log(.1 2 2 22 nn o nn nn nnn nnOn n nn ω= = Θ=+ Ω= Θ=+ = )(.6 nn ω=

×