Java solution using queue and backtracking
Here, first we can generate all the possible combinations using backtracking and then fetch it using queue.\n\n\nclass CombinationIterator {\n\n    private Queu
Here, first we can generate all the possible combinations using backtracking and then fetch it using queue.\n\n```\nclass CombinationIterator {\n\n    private Queue<String> allCombinations;\n    public CombinationIterator(String characters, int combinationLength) {\n        this.allCombinations = new LinkedList<>();\n        generateAllCombinations(characters,0,combinationLength,new StringBuilder());\n    }\n    \n    private void generateAllCombinations(String characters,int index,int combinationLength,StringBuilder currentString){\n        \n        if(currentString.length() == combinationLength){\n            this.allCombinations.offer(currentString.toString());\n            return;\n        }\n        \n        for(int i = index ; i < characters.length() ; i++){\n            currentString.append(characters.charAt(i));\n            generateAllCombinations(characters,i+1,combinationLength,currentString);\n            currentString.deleteCharAt(currentString.length()-1);\n        }\n        \n    }\n    \n    public String next() {\n        return this.allCombinations.poll();\n    }\n    \n    public boolean hasNext() {\n      return !this.allCombinations.isEmpty();\n    }\n}\n```\n
['Backtracking', 'Queue', 'Java']