Is there already modified version of selection sort that works like this pseudocode:a // the array, index starts at 1 (not zero-based)n = len(a)for x in 1 to n  big = x   small = x  last = n-x+1  for y in x+1 to last    if a[big] < a[y] then big = y    if a[small] > a[y] then small = y  if big <> small     if small <> x then swap(a[small],a[x])    if big <> last then swap(a[big],a[last])if there is such an algorithm, what is the name of it?
Min-max selection sort
algorithms;reference request;sorting
As the wikipedia article on selection sort states, this variant is called cocktail sort.