Tag - selection sort algorithm