In one pass over the vector NAs are handled according to parameter
na.last by range_sortna, then, if the vector is unsorted,
binary quicksort is invoked.
Usage
quicksort2(x, na.last = NA)
Value
a sorted vector
Arguments
x
an integer vector
na.last
NA removes NAs, FALSE puts NAs at the beginning,
TRUE puts NAs at the end