1. An apparatus for sorting data, comprising: a Content Addressable Memory storing data to be sorted, the Content Addressable Memory receiving a series of search commands and, in response to each of the search commands, outputting a match address corresponding to each match result; a first memory for storing a copy of the data stored in the Content Addressable Memory, the first memory providing match data corresponding to each match address for each of the search commands; a second memory for sequentially storing the match data for each of the search commands so that sorted data is stored in the second memory, the sorted data being written back to the Content Addressable Memory from the second memory such that a further sorting can be performed on the sorted data, if necessary; and a controller for controlling the sorting apparatus.