A method may include counting the number of times each of a plurality of
entries in a content addressable memory (CAM) matches one or more
searches; grouping entries in the CAM into a first subset and a second
subset based on the number of times each of the plurality of entries in
the CAM matches one or more searches; and searching the first subset for
a matching entry and, if no matching entry is found, searching the second
subset for the matching entry.