Sorting algorithms with minimum memory