{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

tutorial1a

# tutorial1a - Design and Analysis of Algorithms Homework 1...

This preview shows pages 1–7. Sign up to view the full content.

Design and Analysis of Algorithms Homework 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Outline Question 1 Basic Question 2 Basic Question 3 Basic Question 4 Moderate Question 5 Moderate Question 6(a) and 6(b) Challenge
Question 1 Practice to solve the following recurrences: (a) (b) (c) (d) (e) T n  9 T n /2   n 3 T n  7 T n /2   n 3 T n  T n  log n T n  0.5 T n /2   n T n  3 T n /3   n /3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Question 1 You can solve by substitution method, recursion tree method or master theorem T(1) = 1 (if necessary) Do your best to use -notation. If you can not use -notation, then use - notation.
Question 2 Prove that if , then Hint: f n  g n    f n  O g n    lim n  f n  g n 

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Question 3 Merge Sort Recall that it first divides the list into two parts Then sorts each part recursively Merges the two sorted parts Running time: (n log n) 3 1 8 7 6 5 4 2 3 1 8 7 6 5 4 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 30

tutorial1a - Design and Analysis of Algorithms Homework 1...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online