quicksort2: Low-level sorting: binary quicksort

View source: R/bitsort.R

quicksort2R Documentation

Low-level sorting: binary quicksort

Description

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)

Arguments

x

an integer vector

na.last

NA removes NAs, FALSE puts NAs at the beginning, TRUE puts NAs at the end

Value

a sorted vector

Examples

quicksort2(c(2L,0L,1L,NA,2L))
quicksort2(c(2L,0L,1L,NA,2L), na.last=TRUE)
quicksort2(c(2L,0L,1L,NA,2L), na.last=FALSE)

bit documentation built on Sept. 20, 2024, 5:08 p.m.