Presentation is loading. Please wait.

Presentation is loading. Please wait.

Analysis of Algorithms: Methods and Examples CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.

Similar presentations


Presentation on theme: "Analysis of Algorithms: Methods and Examples CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1."— Presentation transcript:

1 Analysis of Algorithms: Methods and Examples CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1

2 Using Limits 2

3 Using Limits: An Example 3

4 4

5 5

6 Big-Oh Transitivity 6

7 7

8 Big-Oh Hierarchy 8

9 Using Substitutions 9

10 10

11 Summations 11

12 Geometric Series A geometric series is a sequence C k of numbers, such that C k = D * C k-1, where D is a constant. How can we express C 1 in terms of C 0 ? – C 1 = D * C 0 How can we express C 2 in terms of C 0 ? – C 2 = D * C 1 = D 2 * C 0 How can we express C k in terms of C 0 ? – C k = D k * C 0 So, to define a geometric series, we just need two parameters: D and C 0. 12

13 Summation of Geometric Series 13

14 Summation of Geometric Series 14

15 Summation of Geometric Series 15

16 Approximation by Integrals 16

17 Solving Recurrences: Example 1 Suppose that we have an algorithm that at each step: – takes O(N 2 ) time to go over N items. – eliminates one item and then calls itself with the remaining data. How do we write this recurrence? 17

18 Solving Recurrences: Example 1 18

19 Solving Recurrences: Example 1 19

20 Solving Recurrences: Example 2 Suppose that we have an algorithm that at each step: – takes O(log(N)) time to go over N items. – eliminates one item and then calls itself with the remaining data. How do we write this recurrence? 20

21 Solving Recurrences: Example 2 21

22 Solving Recurrences: Example 2 22

23 Solving Recurrences: Example 3 Suppose that we have an algorithm that at each step: – takes O(1) time to go over N items. – calls itself 3 times on data of size N-1. – takes O(1) time to combine the results. How do we write this recurrence? 23

24 Solving Recurrences: Example 3 24 finite summation

25 Solving Recurrences: Example 3 25

26 Solving Recurrences: Example 4 Suppose that we have an algorithm that at each step: – calls itself N times on data of size N/2. – takes O(1) time to combine the results. How do we write this recurrence? 26

27 Solving Recurrences: Example 4 27

28 Solving Recurrences: Example 4 28

29 Solving Recurrences: Example 4 29

30 Solving Recurrences: Example 4 30

31 Solving Recurrences: Example 4 31

32 Solving Recurrences: Example 4 32

33 Big-Oh Notation: Example Problem 33

34 Big-Oh Notation: Example Problem 34


Download ppt "Analysis of Algorithms: Methods and Examples CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1."

Similar presentations


Ads by Google