PickPivotAndPartition()
System::MemoryExtensions::Details::PickPivotAndPartition(Span<TKey>&, Span<TValue>&, std::function<int32_t(const TKey&, const TKey&)>) function
Selects pivot and partitions key-value pairs for quicksort.
template<typename TKey,typename TValue> int32_t System::MemoryExtensions::Details::PickPivotAndPartition(Span<TKey> &keys, Span<TValue> &values, std::function<int32_t(const TKey &, const TKey &)> comparer)
Template parameters
Parameter | Description |
---|---|
TKey | The type of keys |
TValue | The type of values |
Arguments
Parameter | Type | Description |
---|---|---|
keys | Span<TKey>& | The span of keys to partition |
values | Span<TValue>& | The span of values to partition |
comparer | std::function<int32_t(const TKey&, const TKey&)> | Comparison function for keys |
Return Value
The pivot index after partitioning
See Also
- Class Span
- Namespace System::MemoryExtensions::Details
- Library Aspose.Slides