Question: How can you write a recursive method public static void sum(int[] a) without needing a helper function? Why is this less efficient?
How can you write a recursive method public static void sum(int[] a) without needing a helper function? Why is this less efficient?
Step by Step Solution
3.47 Rating (157 Votes )
There are 3 Steps involved in it
To write a recursive function to sum all elements of an array the function generally needs additiona... View full answer
Get step-by-step solutions from verified subject matter experts
