
































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

































































The University of Sydney Page 2 2
Progressive Marks - 40% Quizzes 20% Assignments 20%
Final Exam - 60% (minimum 40% required to pass)
One-2-One Helpdesk Next Friday 5-7pm ..? (SCS Building J12 level 2)
The University of Sydney Page 4 4
running time
pseudocode, running time, justifying running time, etc.
Given functions f ( n ) and g ( n ), we say that f ( n ) is O ( g ( n )) if there are positive constants c and n 0 such that
f ( n ) ≤ cg ( n ) for n ≥ n 0
Example: 2 n + 10 is O ( n )
2 n + 10 ≤ cn ( c − 2) n ≥ 10 n ≥ 10/( c − 2) Pick c = 3 and n 0 = 10
1 2 3 4 5 6 7 8 1 0 1 1 0 0 0 0 0 2 1 0 1 1 1 0 0 0 3 1 1 0 0 1 0 1 1 4 0 1 0 0 1 0 0 0 5 0 1 1 1 0 1 0 0 6 0 0 0 0 1 0 0 0 7 0 0 1 0 0 0 0 1 8 0 0 1 0 0 0 1 0
1 2 3 2 3 4 2 5 5 6 7 3 8 8
1 3 4 5 1 2 5 7 8
2 3 4 6 5
3 7
0 1 2 3 4 5 6 7 8 9 10 11 Time
f g h
e
a b c d
0 1 2 3 4 5 6 7 8 9 10 11 Time
f g h
e
a b c d
...
J 1 J 2 J (^) r
i 1 i 1 i (^) r i (^) r+
...
Greedy:
OPT: Jr+
Why not replace job J (^) r+ with job i (^) r+1?
job i (^) r+1 finishes before J (^) r+
9 9:30 10 10:30 11 11:30 12 12:30 1 1:30 2 2:30 Time
h
c b a
e
d g
f i
j
3 3:30 4 4: