'Recursion calling in loops .. can anyone tell me the compilation process for this code

void fun(vector &arr,int n,int i,int k, vector &v,vector<vector>&ans){

if(k==0){

   ans.push_back(v);

}

if(i>=n) return ;

for(;i<n;i++){

   v.push_back(arr[i]);

 fun(arr,n,i+1,k-arr[i],v,ans);

 v.pop_back();

}

}



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source