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

Method add

src/data_structures/heap.rs:79–82  ·  view source on GitHub ↗

Adds a new element to the heap and maintains the heap property. # Parameters - `value`: The value to add to the heap.

(&mut self, value: T)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 6

test_min_heapFunction · 0.45
test_max_heapFunction · 0.45
test_iter_heapFunction · 0.45
test_from_vec_minFunction · 0.45
test_from_vec_maxFunction · 0.45
kth_smallest_heapFunction · 0.45

Calls 3

pushMethod · 0.80
heapify_upMethod · 0.80
lenMethod · 0.45

Tested by 5

test_min_heapFunction · 0.36
test_max_heapFunction · 0.36
test_iter_heapFunction · 0.36
test_from_vec_minFunction · 0.36
test_from_vec_maxFunction · 0.36