techInterview Discussion

A part of techInterview.org: answers to technical interview questions.

Your host: Michael Pryor

Functions..

can the following function be implemented without using recursion:
        F(n)=max(n,(F(n/2)+F(n/3)+F(n/4)))
        F(0)=0 and n>=0
is a solution in lines of the fibonacci series dynamic  programming solution possible where space complexity is o(1)?
Any help will be appreciated.
Prajata Das Chowdhury Send private email
Saturday, June 12, 2010
 
 
failed to add the divisions will return the floor value.
So F(3)=max(3,(F(1)+F(1)+F(0)))
Hopefully the problem is understood.
Prajata Das Chowdhury Send private email
Saturday, June 12, 2010
 
 
By Akra--Bazzi, it's Theta(x^p) where (1/2)^p + (1/3)^p + (1/4)^p = 1. (p ~ 1.08) I'm not optimistic about the possibility of Fibonacci-like implementation.
d Send private email
Sunday, June 13, 2010
 
 
http://www.carsinsurance4u.com/ low car insurance ppfe http://www.autosinsurancequotes4u.com/ state auto insurance 4161 http://www.carsinsurancecompanies.com/ cheap insurance ewat http://www.free-home-insurance-quotes.net/ homeowners insurance %)))

Friday, July 02, 2010
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz