Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro.

Similar presentations


Presentation on theme: "Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro."— Presentation transcript:

1 Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro. To Algorithms” book website (copyright McGraw Hill) adapted and supplemented

2 CLRS “Intro. To Algorithms” Ch. 3: Growth of Functions

3

4 More to Discuss o-notation Monotonically/strictly increasing/decreasing Floors and ceilings Modular arithmetic Fibonacci numbers: 0, i = 0 F i = 1, i = 1 F i-1 + F i-2, i  2 How to write code to compute Fibonacci numbers (recursively or iteratively)? lg * n = min{i: lg (i) n ≤ 1}

5 Problems Ex. 3.1-4 Is 2 n+1 = O(2 n )? Is 2 2n = O(2 n )? Ex. 3.1-5 Prove Theorem 3.1. Theorem 3.1 For any two functions f (n) and g(n), we have f (n) = θ(g(n)) if and only if f (n) = O(g(n)) and f (n) = Ω(g(n)). Ex. 3.2-2 Prove equation (3.15). a log b c = c log b a (3.15)


Download ppt "Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro."

Similar presentations


Ads by Google