Algorithm (especially for c++) to show Every Permutation

You want all permutations of each member of the powerset of the input. permSub(“abc”, “”) func permSub(input, perm) print perm if input = “” return for i = 0 to input.length-1 permSub(input[0..i]+input[i+1..input.length), perm+input[i] end end Where input[i..j] represents the sub string of input from i(inclusive) to j(exclusive), and + is string concatenation. Note that this … Read more