Sort at most the first n elements of r using comparison less using a networking sort.
Note: Sorting networks are not unique, not even optimal solutions.
http://stackoverflow.com/questions/3903086/standard-sorting-networks-for-small-values-of-n
http://www.cs.brandeis.edu/~hugues/sorting_networks.html
See Implementation
Sort at most the first n elements of r using comparison less using a networking sort.
Note: Sorting networks are not unique, not even optimal solutions.