Array Split problem

i am not able to solve array split question in assignment can you give me some hits for the same.

Hi Kirti,share the link of the question.

here
https://hack.codingblocks.com/contests/c/492/511

Hi Kirti,in this question make a recursive function in which firstly you make a recursive call for first array in which you keep on adding the elements in that array from the original array and its corresponding sum and keep rest of the the parametres same of the second arrayand then you will make a recursive call like this for array 2 and the base case will be that if your both the sums are same then print the arrays else return. basically you add one element in the array1 and then corresponding to that you add elements in array2 and then you will check the sums of both.

sorry but i didn’t get it .Can you please explain it with the help of recurssion tree because i have tried to do it with back tracking but the answer comes out to be horribly wrong

Hi Kirti,i have made a recursion tree call diagram for array input 1,2,3.hope it will help you.


For your help i am also sharing the code with you from there you will get more clear that how calls are going in the recursion tree.

1 Like

Thank you for your help .now i got it :slight_smile: