i have a question about Tail recursion. As i know Tail recursion is when the last recursive call from function will deliver the result of the function. But when i have a function like this
def func1(n: Int): Int = {
if (n > 100) {
n - 10
}
else {
func1(func1(n + 11))
}
}
would it be tail recursion ? For example
func1(100) = func1(func1(111)) = func1(101) = 91
so the last recursive call would be func1(101) and it should deliver the results so that would be tail recursion right? I'm a little confused. Thank you!