1. A method to store data in a content-addressable memory (CAM) with a plurality of memory sets, the method comprising: receiving a plurality of data values to be stored in the CAM, wherein each data value of the plurality of data values has two or more bits; determining an index for a data value, of the plurality of data values, wherein: determining the index includes evaluating a distribution of bit values at each bit position in the plurality of data values, evaluating the distribution of bit values at each bit position includes evaluating a frequency of variation of the bit values at corresponding bit positions in the plurality of data values, the index for the data value includes at least one bit of the data value, and the at least one bit corresponds to a bit position at which bit values, of the plurality of data values, vary more frequently than bit values at other bit positions; identifying, based on the determined index, a memory set from the plurality of memory sets of the CAM; and storing the data value in a storage unit of the identified memory set.