Implementation of several sorts in data structure