To write a recursive method that print an input string in a reverse “V” shape
and then a “V” shape
Example:
If the input string is “1234567” which has an odd number of characters,
then the output is:
***4***
**3*5**
*2***6*
1*****7
1*****7
*2***6*
**3*5**
***4***
If the input string is “abcdef” which has an even number of characters,
then the output is:
**cd**
*b**e*
a****f
a****f
*b**e*
**cd**
I'm not sure which one to use here.
- public static void printVshape (String str, int i)
- public static void main(String[] args)
If I start with the first one,
I get to this:
public static void printVshape (String str, int
i)
{
if(i<0) return;
String outline;
(not sure what to do next)
but if I use the second one I have to use a scanner object.
Can someone finish the code for me?