I need to write code for a recursive function, which actually operates on an array and divides the array in two new arrays, of unequal size based on certain condition, (say, using condition function X). After that the the function keeps on operating on each of the newly created arrays until the arrays contain only one element each. Can you help me with a code that actually can do this. I am giving a rough idea about what I need to do. :
recursive_function func1 (array) {
conditional_function X();
creates, array1[] and array2[]
perform the same on each of array1 and array2
until all arr
}
You can use System.arrayCopy to do this
Ex: