{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Solutions of Final 2

# Solutions of Final 2 - … T(2-T(0 = log(2 The sum of all...

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

Solutions of Final 2 Question 2 a. T(n) = T(n/2) + T (n 1/2 ) + n Let n 1/2 = m T(m 2 ) = T(m 2 /2) + T(m) + m 2 T(m 2 /2) - m 2 = T(m) Therefore, T(m) = O(m 2 ) By Re-Substituting, T(n 1/2 ) = O(n) T(n) = O(n 2 ) b. T(n) =T(n-2) + log n T(n) – T(n-2) = log (n) T(n-2)-T(n-4)=log(n-2) T(n-4)-T(n-6)=log(n-4)

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ….. T(2)-T(0) = log(2) The sum of all of these equations is T(n)– T(0) = log(n) + log(n-2)+…+log(2) //using telescopic summation T(n) – T(0)=log(n*(n-2)*(n-4)…. .) Assume that T(0) is constant, therefore T(n) =O( log(n!))...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

Solutions of Final 2 - … T(2-T(0 = log(2 The sum of all...

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

View Full Document
Ask a homework question - tutors are online