Skip to main content
deleted 201 characters in body; edited title
Source Link
Ubi.B
  • 220
  • 2
  • 16

If it is beneficial, then how Big-O (time complexity) is affected? Embedded link provided by members does not answer original question.

If it is beneficial, then how Big-O (time complexity) is affected?

If it is beneficial, then how Big-O (time complexity) is affected? Embedded link provided by members does not answer original question.

deleted 201 characters in body; edited title
Source Link
Ubi.B
  • 220
  • 2
  • 16

Is it possiblebeneficial to convert all recursion to tail recursion?

Recursion is very expensive andIf it is poorly supported by many popular programming languages. Drop a large input into a recursive algorithm in Python, and you’ll probably hit the runtime’s recursion limit. Raise the limitbeneficial, and you may run out of stack space and segfault.then how Big-O (time complexity) is affected?

Is it possible to convert all recursion to tail recursion?

Recursion is very expensive and is poorly supported by many popular programming languages. Drop a large input into a recursive algorithm in Python, and you’ll probably hit the runtime’s recursion limit. Raise the limit, and you may run out of stack space and segfault.

Is it beneficial to convert recursion to tail recursion?

If it is beneficial, then how Big-O (time complexity) is affected?

Source Link
Ubi.B
  • 220
  • 2
  • 16

Is it possible to convert all recursion to tail recursion?

Recursion is very expensive and is poorly supported by many popular programming languages. Drop a large input into a recursive algorithm in Python, and you’ll probably hit the runtime’s recursion limit. Raise the limit, and you may run out of stack space and segfault.