What is the optimal data structure to use, knowing that the data to be stored consists of a fixed number of unique values, where order matters? In particular, I’m trying to optimally store the state of a deck of 52 cards, where each card is represented by a number from 1 to 52.
Share
If your only concern is expressing the permutation (wrt the natural order), you could choose a factorial number system, which is the smallest thinkable representation for a permutation.
BTW: this is not a very practical solution; 52! is approximately 8E67 😉