Digit combination string [modified]
-
Hi! I wan't to construct a list of numbers which covers all combinations of those numbers. Say for example that I want all combinations of the numbers 1 2 3 4, with the lenght of four (or say numbers 1 to 9 but still with the lenght of four, or if I know that '2' must be in the combination i.e. 2xxx, x2xx, xx2x or xxx2), like 1234, 1324 etc, but as a sequential string, e.g. 1234232 etc, where every new number becomes a new combination (in this case that string tests 1234, 2342, 3423, 4232). How can I construct such an algorithm to finde the shortest possible string covering all combinations? I think it's called Euler path, but not sure. Did some googling. Anyone who can push me in the right direction? Maybe an implementation as well? Thanks in advance!
modified on Wednesday, October 1, 2008 4:41 AM