Skip to main content

qsort

Function qsort 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn qsort( base: *mut c_void, nel: usize, width: usize, compar: Option<extern "C" fn(*const c_void, *const c_void) -> i32>, )
Expand description

Rust implementation of C library function qsort

compar(a, b) returns a negative value if a < b, 0 if a == b, and a positive value if a > b

The implementation is based on introsort, which is a hybrid sorting algorithm that provides both fast average performance and (asymptotically) optimal worst-case performance.