J
J
JustFailer2016-08-05 13:59:42
Java
JustFailer, 2016-08-05 13:59:42

Does the stack grow if the recursive function call is the last operation?

I apologize if the question is incorrect.
For example, there is a function like:

void doSomething() {
    // [...]
    if (a==0) {
        doSomething();
    }
}

In tags and C ++, and Java. interesting differences.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Сергей Горностаев, 2016-08-05
@JustFailer

В Java нет оптимизации хвостовой рекурсии.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question