From 9b154bf0643d1a6b768f69cc3fac97afe2bdea6f Mon Sep 17 00:00:00 2001 From: anirudhgeek21 Date: Mon, 23 Oct 2023 14:58:34 +0530 Subject: [PATCH] Powerset problem in recursion --- .../Recursion/Subsets-Of-array-recusion.cpp | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 algorithms/CPlusPlus/Recursion/Subsets-Of-array-recusion.cpp diff --git a/algorithms/CPlusPlus/Recursion/Subsets-Of-array-recusion.cpp b/algorithms/CPlusPlus/Recursion/Subsets-Of-array-recusion.cpp new file mode 100644 index 00000000..451fa6aa --- /dev/null +++ b/algorithms/CPlusPlus/Recursion/Subsets-Of-array-recusion.cpp @@ -0,0 +1,45 @@ +//Program to get all the subsets/powersets of any array + + + +#include +#include +using namespace std; + + +void GetSubsets(int nums[],int index,vector arr1,int n){ + + + if(index == n){ + for(auto it:arr1){ + cout<< it<<" "; + } + cout< arr3; + GetSubsets( arr2 ,index,arr3,n); +} + + + + + + + + +