Comments on reverse string:
Note that the argument to the recursive callrev(s.substring(1))has one less character than parameter s.
Therefore, the �depth� of recursion --the maximum number of recursive calls with frames that will exist at any time-- is the number of characters in s.
Note that in the simple case (length 1), there is no recursive call
All of this suggests that the recursion will terminate