Implementation of ColumnSort without parallel programming. Uses either mergesort or counting sort to sort the columns.