@piyuesh..i posted the naive because geeks are so confused about this quest. i have seen some geeks saying terrible time complexity of it. so above approach will make 1st of all every1clear optimization 2ndary step...
As i have told earlier its similar to find nth Fibonacci number can be done in O(logn) using Matrix Representation that i also know & will post later..its little modification of nth Fibonacci number. Thanks Shashank Reach Me +99-9739002481 -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
