Java Array Recursion

后端 未结 7 1328
醉梦人生
醉梦人生 2021-01-17 02:46

The purpose of this assignment is to learn recursive methods. For this particular problem, I need to print the values of list, one per line. The skeleton of the

7条回答
  •  囚心锁ツ
    2021-01-17 03:48

    I won't give you direct answer, since you won't learn anything from it. You can create the variable to store current depth. Create getter and setter helper methods to increase the depth of recursion. Your method list, will call itself, with the same array, but only after you check that the depth is not bigger then the size of array. Don't forget to increase the depth of the recursion on every call.

提交回复
热议问题