Heapify()

System::MemoryExtensions::Details::Heapify(Span<TKey>&, Span<TValue>&, int32_t, int32_t, std::function<int32_t(const TKey&, const TKey&)>) function

Maintains heap property for key-value pairs.

template<typename TKey,typename TValue> void System::MemoryExtensions::Details::Heapify(Span<TKey> &keys, Span<TValue> &values, int32_t n, int32_t i, std::function<int32_t(const TKey &, const TKey &)> comparer)

Template parameters

ParameterDescription
TKeyThe type of keys
TValueThe type of values

Arguments

ParameterTypeDescription
keysSpan<TKey>&The span of keys in the heap
valuesSpan<TValue>&The span of values in the heap
nint32_tSize of the heap
iint32_tIndex to heapify from
comparerstd::function<int32_t(const TKey&, const TKey&)>Comparison function for keys

See Also