T(n) = sqrt(n) T(sqrt(n)) + sqrt(n) and T(4) = 1 does solve to T(n) = O(n).

Just guess T(n) = n - sqrt(n).

Note that I chose the base case to make life easy for myself, choosing the more natural base case T(1) = 1 will not really change anything but the constants. OTOH, if you chose T(n) = sqrt(n) T(sqrt(n)) + n, it would give you T(n) = O(n log log n). But that's a different story, it's not what we needed today.

## Monday, October 5, 2009

Subscribe to:
Post Comments (Atom)

## No comments:

## Post a Comment