0
Solve this problem with recursion
Suppose you are given an array A, which has n elements. Write a recursive function to print that array in the following order. A[0] A[n-1] A[1] A[n-2] A[3] A[n-3] ......... ......... A[(n-1)/2] A[n/2], Where n >=2. Input : 5 1 5 7 8 9 Output: 1 9 5 8 7 7 ***How can I use local variable in the recursive function? Is it possible to use without initialize in every iteration?
2 Respostas
0
I'm not solving the problem. Just answering the last part.
If you want to use the variable in each recursion use static variable.
0
Remember that, for your learning process, you should solve the problem, with the help you can get, not anyone else.