jakepaul
jakepaul

Reputation: 1

Do recursive and iterative solutions to a problem have same worst time complexity?

If there is a theory existing that proves this, what is it to prove that both would give the same worst case time complexity? It has been showed that both can provide solutions to a problem, but nothing about both giving same worst case time complexity.

Upvotes: 0

Views: 63

Answers (1)

cgDude
cgDude

Reputation: 93

It completely depends on the problem. But generally, recursive solutions can be made more time-efficient by using dynamic programming.

Upvotes: 2

Related Questions