From my understanding, tail recursion is when the recursive call of an algorithm is the final step, and tail recursion optimization is when the compiler lifts the recursive call off of the stack to save memory. I know this is present in Scala, and I believe it is also present for C++'s GCC compiler though not for Java’s JVM.
Is this a legitimate tactic competitive programmers use to make their programs take up less memory? It seems like it would be, but I have never seen it in any tutorial.
If it is a tactic, does it work oftentimes?