MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / heap_sort

Function heap_sort

src/sorting/heap_sort.rs:65–79  ·  view source on GitHub ↗

Sorts the given array using heap sort algorithm. This function sorts the array either in ascending or descending order based on the `ascending` parameter. # Arguments `arr` - A mutable reference to the array to be sorted. `ascending` - A boolean indicating whether to sort in ascending order (`true`) or descending order (`false`).

(arr: &mut [T], ascending: bool)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 3

build_heapFunction · 0.85
heapifyFunction · 0.70
lenMethod · 0.45

Tested by

no test coverage detected