Utmost Number of Recursions in Widely Used Programing Language? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Utmost Number of Recursions in Widely Used Programing Language?

Does anyone know the number of utmost recursion depth in the following programming languages: C, C++, Java, Javascript,, etc. ( e.g. I know for python the default value is less than 1000 unless you increase it manually)

3rd May 2020, 1:40 PM
Hadi Fadakar Sani
1 Answer
- 1
C/C++/Java : Depends on stack size. The maximum recursion depth in C depends on a lot of factors, of course. On a typical 64-bit Linux system the default stack size is 8 MB, and the stack alignment is 16 bytes, so you get a recursion depth of about 512K for simple functions. (Source: https://codegolf.stackexchange.com/a/141281) Javascript : Depends on browser. It is usually 10000. Python : 1000
4th May 2020, 11:46 AM
Amey Bhavsar
Amey Bhavsar - avatar