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

Function heapify

src/sorting/heap_sort.rs:32–55  ·  view source on GitHub ↗

Fixes a heap violation starting at the given index. This function adjusts the heap rooted at index `i` to fix the heap property violation. It assumes that the subtrees rooted at left and right children of `i` are already heaps. # Arguments `arr` - A mutable reference to the array representing the heap. `i` - The index to start fixing the heap violation. `is_max_heap` - A boolean indicating whet

(arr: &mut [T], i: usize, is_max_heap: bool)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

build_heapFunction · 0.70
heap_sortFunction · 0.70

Calls 2

cmpMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected