Is there a performance hit if we use a loop instead of recursion or vice versa in algorithms where both can serve the same purpose? Eg: Check if the given string is a palind
It depends on the language. In Java you should use loops. Functional languages optimize recursion.