Iterative is generally better than Recursive in Python?

  • 0

    I have done several Leetcode problems with python. In general I feel that using python, iterative solutions are generally faster than recursive ones. For some problems, recursive solutions will exceed time limit, while iterative ones will not. Does anyone have similar feeling? Is it generally true for python?

  • 0

    I've used Python a lot here and I did not get that impression. Do you have an example where it makes any significant difference?

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.