C++ | Recursion
\nclass CombinationIterator {\npublic:\n    vector<string>v;    \n    \n\t// generate all combinations\n    void fun(string op,string ip,int len)\n    {\n      
```\nclass CombinationIterator {\npublic:\n    vector<string>v;    \n    \n\t// generate all combinations\n    void fun(string op,string ip,int len)\n    {\n        if(ip.size()==0)\n        {\n            if(op.size()==len)\n            {\n                v.push_back(op);                \n            }\n            return;\n        }\n        string op1=op;\n        string op2=op;\n        \n        op2.push_back(ip[0]);\n        ip.erase(0,1);\n        \n        fun(op1,ip,len);\n        fun(op2,ip,len);\n    }\n    \n    CombinationIterator(string str, int len) {        \n        string op="";\n        fun(op,str,len);        \n        \n    }\n    \n    string next() {        \n        string ans=v.back();\n        v.pop_back();\n        return ans;\n    }\n    \n    bool hasNext() {\n        return v.size();\n    }\n};\n\n/**\n * Your CombinationIterator object will be instantiated and called as such:\n * CombinationIterator* obj = new CombinationIterator(characters, combinationLength);\n * string param_1 = obj->next();\n * bool param_2 = obj->hasNext();\n */\n```
['Recursion', 'C']