C++ Sorts

C++: Heap Sort

 
   

#include <algorithm> // for std::make_heap, std::sort_heap

template <typename Iterator>
void heap_sort(Iterator begin, Iterator end)
{
	std::make_heap(begin, end);
	std::sort_heap(begin, end);
}

SOURCE

 
 
   

Become a TFE Insider!