Not getting recursive logic

not getting recursive logic pls help

Hey
You’ve to find all the subsets and check if any subset’s sum is zero.

Algo for generating subsets:

  1. Create a recursive function that takes the following parameters, input array, the current index, the current sum.
  2. if the current index is equal to the size of the array, then check whether the sum is equal to zero…
  3. There are exactly two choices for very index.
  4. Ignore the current element and call the recursive function with the current subset and next index, i.e i + 1.
  5. Insert the current element in the subset and call the recursive function with the current subset and next index, i.e i + 1.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.