??????%20?????%20-%20Recurrences - PowerPoint PPT Presentation

About This Presentation
Title:

??????%20?????%20-%20Recurrences

Description:

??? ???? - BIG O * ????? ???????? ?? ???? ????? (???? ????): - ???? c ?- ?? ?: ?????: ... o - ???? ????? ????? ?????? ??????????. for any c 0 there exists n0 0 ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 25
Provided by: thearbe
Category:

less

Transcript and Presenter's Notes

Title: ??????%20?????%20-%20Recurrences


1
???? ????????
?????
???? ????? ?????? ??????
?????? ?? ?????? (????????)
???? ???????? ??????
?????? ????? - Recurrences
Substitution - ????
???????
The Master Method
2
????? ?????? ???????-???
Data Structures, CS, TAU - 2.2
3
????? ????????? ????? ??????
????? ????? ?? ???? ??? (???? 3).
(3.1) found false (3.2) for each vertex W
in newclr do (3.3) if there is an edge
between V and W in G then (3.4)
found true (3.5) if found false then
begin (4) . . . (5) .
. .
Data Structures, CS, TAU - 2.1
4
???? ????? ?????? ??????
?????? ????? ???? ?????? (????? - ?????
??????, ???? ?????? - ????? ????)
Data Structures, CS, TAU - 2.3
5
Abstract Data Types
????- ???? ??? ????? ??? ?????? (??????? ???
?????? ?????, ?????)
?????- ????? ??? ????? ??????? ???? ?????
???? ??? ????? ??? ?????? ???? ???????
????? SET
????
???? SET

????? ?????? ?????? - ????? ?????? LIST ??????
1. MAKENULL (newclr) 2. W FIRST
(newclr) 3. W NEXT (newclr) 4. INSERT (v,
newclr)
Data Structures, CS, TAU - 2.4
6
????? ?-GRAPH
1. ??? ????? ?????? ??? ????
2. ???? ??? ?? ??? ??? 2 ?????
3. ??? ???? ?????
4. ??? ?? ????? ???
????
????? ???? ??????
???? ???? ?????? ???????? ???
???? ?????? ?? ?????? ??????? ????
???? ????? ?????? ????? ???????
Data Structures, CS, TAU - 2.5
7
?????? ?? ?????? (????????(
Upto here 2/11/05
????? ??????
?????
???? ??????, ????? ??????, ??????
(?????? ???????)
?? ???????, ??? ???????.
??????
??????? ?? ??? ????, ??? ????, ????????
?????, ???? ???? ?????
8
?????
???? ?????? ????? ?????? ?? ???? ???? ?? 10 - ??
???? ????? ??????
Data Structures, CS, TAU - 2.7
9
????? ???? ???? ?? 64
?????? ??? ????
Data Structures, CS, TAU - 2.8
10
?????
Procedure bubble var I, j, temp integer
begin (1) for I 1 to n-1 do (2) for j
n downto I1 do (3) if Aj-1 gt Aj
then begin swap Aj-1 and
Aj (4) temp Aj-1 (5)
Aj-1 Aj (6) Aj temp
end end bubble
Data Structures, CS, TAU - 2.9
11
????? ????? ???? (????????)
Function fact (n integer) begin (1) if nlt1
then (2) fact 1 else (3) fact
nfact(n-1) end fact
Data Structures, CS, TAU - 2.10
12
???? ???????? ??????
??? ?????
??? ?????
??? ????? ??????
exist c, n0 such that
f(n) exist c1, n0, c2 such that
Data Structures, CS, TAU - 2.11
13
??? o ???
O ???? ????? tight (????) ?? ??.
o - ???? ????? ????? ?????? ??????????
for any cgt0 there exists n0gt0 such that
?????????? ?????????? ??? ?? ????????
?????
f(n)
g(n)
Data Structures, CS, TAU - 2.12
14
???? ???? ????????
Data Structures, CS, TAU - 2.13
15
???? ?????
Cormen 1, 2.1-2.2
1.
2.
Growth of functions
????? ??
(?? ?????? ??? ????? ?????)
Data Structures, CS, TAU - 2.14
16
?????? ????? - Recurrences
Recurrence ?????? (??-???????) ?????? ???????
?? ????? ????? ?? ????????
????? ??????
1) Substitution
2) Iteration
3) Master
Data Structures, CS, TAU - 2.15
17
1. SUBSTITUTION (????)
?. ??? ??????
?????
?. ???? ??????????
?????
????
Data Structures, CS, TAU - 2.16
18
2. ???? ?????? ???? ???? ?????
??????
????
????? ?????
???? ?-n ???? ????
Proof claim if T(x)ltc x logx holds for 2,3,,
n-1 then holds for n. proof n/2gt 2 and thus is
correct.
?????? ??????
1) ????? c - ??? ???? ???? ???? ????? ??????????.
2) ?? ?????? ?? ????? - ???? ?????? ?? ?????.
3) ???? ????? O ??????.
Data Structures, CS, TAU - 2.17
19
?????
???????
Data Structures, CS, TAU - 2.18
20
2. ???? ????????
????? ?????
Accounts for tail cutting. Can be dropped since
there is an inequality
Data Structures, CS, TAU - 2.19
21
3. THE MASTER METHOD
Upto here 30/10//06
Master Thm
Data Structures, CS, TAU - 2.20
22
????? 1
Data Structures, CS, TAU - 2.21
23
????? 2
Data Structures, CS, TAU - 2.22
24
????? 3
???? n ????
Data Structures, CS, TAU - 2.23
Write a Comment
User Comments (0)
About PowerShow.com