M
Matt Chwastek
Anyone who can help,
I am curretnly attempting to write some code that will allow iteration
using a vector<int> from the highest possilbe degree of a combination
of ones & zeros (111, 110, 101, 011, 100, 010, 001, 000). The ordering
of element containing the same number of ones is not important to the
code, just the fact that the highest number of ones are iterated first.
I would prefer not to use a binary string as eventually the
combinations will change to combination of any numbers (0,1,2,3,etc.)
I have looked at several implementation of Gray Codes, but have not
been able to figure out a way to complete this iteration cleanly.
Any help or suggestions on where else to look would be greatly
appreciated.
Thanks
Matt
I am curretnly attempting to write some code that will allow iteration
using a vector<int> from the highest possilbe degree of a combination
of ones & zeros (111, 110, 101, 011, 100, 010, 001, 000). The ordering
of element containing the same number of ones is not important to the
code, just the fact that the highest number of ones are iterated first.
I would prefer not to use a binary string as eventually the
combinations will change to combination of any numbers (0,1,2,3,etc.)
I have looked at several implementation of Gray Codes, but have not
been able to figure out a way to complete this iteration cleanly.
Any help or suggestions on where else to look would be greatly
appreciated.
Thanks
Matt