C# - Using Enumerator and BFS to generate next word
csharp\npublic class CombinationIterator\n{\n    private bool canMove;\n    private string nextResult;\n    private IEnumerator<string> resultEnumerator;\n\n   
```csharp\npublic class CombinationIterator\n{\n    private bool canMove;\n    private string nextResult;\n    private IEnumerator<string> resultEnumerator;\n\n    public CombinationIterator(string characters, int combinationLength)\n    {\n        resultEnumerator = getAllCombinations(characters, string.Empty, 0, combinationLength).GetEnumerator();\n        if (resultEnumerator.MoveNext())\n        {\n            nextResult = resultEnumerator.Current;\n            canMove = true;\n        }\n        else\n        {\n            nextResult = null;\n            canMove = false;\n        }\n    }\n\n    public string Next()\n    {\n        string result = nextResult;\n        if (resultEnumerator.MoveNext())\n        {\n            nextResult = resultEnumerator.Current;                    \n        }\n        else\n        {\n            canMove = false;\n            nextResult = null;\n        }\n\n        return result;\n    }\n\n    public bool HasNext()\n    {\n        return canMove;\n    }\n\n    private IEnumerable<string> getAllCombinations(string s, string currentWord, int index, int length)\n    {\n        if (length == 0)\n        {\n            yield return currentWord;\n        }\n\n        for (int i = index; i < s.Length; i++)\n        {\n            var result = getAllCombinations(s, currentWord + s[i], i + 1, length - 1);\n            foreach (var r in result)\n            {\n                yield return r;\n            }\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```
['Breadth-First Search']