Lecture 2: O-notation (Why Constants Matter Less)
COMS10007 - Algorithms
- Dr. Christian Konrad
29.01.2019
- Dr. Christian Konrad
Lecture 2: O-notation (Why Constants Matter Less) 1 / 15
Lecture 2: O -notation (Why Constants Matter Less) COMS10007 - - - PowerPoint PPT Presentation
Lecture 2: O -notation (Why Constants Matter Less) COMS10007 - Algorithms Dr. Christian Konrad 29.01.2019 Dr. Christian Konrad Lecture 2: O -notation (Why Constants Matter Less) 1 / 15 Runtime of Algorithms Runtime of an Algorithm Function
Lecture 2: O-notation (Why Constants Matter Less) 1 / 15
Lecture 2: O-notation (Why Constants Matter Less) 2 / 15
5 10 15 20 25 30 35 40 1 2 3 4 5 6 7 8 9 10 runtime 4(n-1) 5log(n) 0.1 n2 n log(n / 2) 0.01 2n
Lecture 2: O-notation (Why Constants Matter Less) 3 / 15
50 100 150 200 250 300 350 2 4 6 8 10 12 14 runtime 4(n-1) 5log(n) 0.1 n2 n log(n / 2) 0.01 2n
Lecture 2: O-notation (Why Constants Matter Less) 3 / 15
20 40 60 80 100 120 5 10 15 20 25 30 runtime 4(n-1) 5log(n) 0.1 n2 n log(n / 2)
Lecture 2: O-notation (Why Constants Matter Less) 3 / 15
50 100 150 200 250 5 10 15 20 25 30 35 40 45 50 runtime 4(n-1) 5log(n) 0.1 n2 n log(n / 2)
Lecture 2: O-notation (Why Constants Matter Less) 3 / 15
500 1000 1500 2000 2500 3000 3500 4000 20 40 60 80 100 120 140 160 180 200 runtime 4(n-1) 5log(n) 0.1 n2 n log(n / 2)
Lecture 2: O-notation (Why Constants Matter Less) 3 / 15
Lecture 2: O-notation (Why Constants Matter Less) 4 / 15
f(n) g(n) n0
Lecture 2: O-notation (Why Constants Matter Less) 5 / 15
Lecture 2: O-notation (Why Constants Matter Less) 6 / 15
1 f (k) ≥ g(k) and 2 f ′(n) ≥ g′(n) for every n ≥ k .
Lecture 2: O-notation (Why Constants Matter Less) 7 / 15
Lecture 2: O-notation (Why Constants Matter Less) 8 / 15
Lecture 2: O-notation (Why Constants Matter Less) 9 / 15
5000 10000 15000 20000 10 20 30 40 50 60 70 80 90 100 0.5n2 - 10n 2n2
Lecture 2: O-notation (Why Constants Matter Less) 10 / 15
5000 10000 15000 20000 25000 10 20 30 40 50 60 70 80 90 100 0.5n2 - 10n 2n2 6(0.5n2 - 10n)
Lecture 2: O-notation (Why Constants Matter Less) 10 / 15
Lecture 2: O-notation (Why Constants Matter Less) 11 / 15
Lecture 2: O-notation (Why Constants Matter Less) 12 / 15
Lecture 2: O-notation (Why Constants Matter Less) 13 / 15
Lecture 2: O-notation (Why Constants Matter Less) 14 / 15
Lecture 2: O-notation (Why Constants Matter Less) 15 / 15