Programming Search⌘K

std.sort

The entries of std.sort in the Zig reference. This page has 20 cards.

std.sort.equalRange

pub fn equalRange(comptime T: type, items: []const T, context: anytype, comptime compareFn: fn (@TypeOf(context), T) std.math.Order) struct

Returns a tuple of the lower and upper indices in `items` between which all elements return `.eq` when given to `compareFn`.

Kind
function
Module
std.sort

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.sort.lowerBound

pub fn lowerBound(comptime T: type, items: []const T, context: anytype, comptime compareFn: fn (@TypeOf(context), T) std.math.Order) usize

Returns the index of the first element in `items` that is greater than or equal to `context`, as determined by `compareFn`.

Kind
function
Module
std.sort

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.sort.pdq

pub fn pdq(comptime T: type, items: []T, context: anytype, comptime lessThanFn: fn (context: @TypeOf(context), lhs: T, rhs: T) bool) void

Unstable in-place sort. n best case, n*log(n) worst case and average case. log(n) memory (no allocator required).

Kind
function
Module
std.sort

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.sort.upperBound

pub fn upperBound(comptime T: type, items: []const T, context: anytype, comptime compareFn: fn (@TypeOf(context), T) std.math.Order) usize

Returns the index of the first element in `items` that is greater than `context`, as determined by `compareFn`.

Kind
function
Module
std.sort

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.