Question: PLEASE IMPLEMENT YOUR SOLUTION IN C++ (6) Given a set of ASCII characters bSet, design a recursive algorithm to print power set (i.e. the collection
PLEASE IMPLEMENT YOUR SOLUTION IN C++


(6) Given a set of ASCII characters bSet, design a recursive algorithm to print power set (i.e. the collection of all subsets) of the given set bSet, including the empty set and bSet itself. For example, if bSet is {xyz), then the powerset of bSet Includes the following items (xy) XZ tyz) fxyz) t:vectorctid:stringtt,const tst In the above powerSetO function declaration, the function computes the power set (i.e. all the subsets) of a given set of characters, including the empty set and S itself. The input variable bSet is a string that holds the given set of characters, pSet is a vector of string and is passed to the function to store the power set of bSet. Each string in pSet is a subset of bSet. After the function execution, bSet should not be modified and pSet should hold the power set of bSet. You can assume the string bSet has no duplicated characters in it. You can modify the powerSet0 function declaration to add additional parameters. However, those additional parameters need to have default initialization value. In this way, a user of the function only needs to provide pSet and bSet and no additional information is needed when calling powerSet0. For example, you can have the following declaration of function: void powerSet(std:vector std::string>& pSet, const std: string bSet, int extraPara-0), This declaration is compatible with the following code: std:vector<:string> pSet std:string bSet-"ab"; powerSet(pSet, bset)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
