Template Function ADS::heapBuildByInsertion

Function Documentation

template<class T, class C = std::less<>>
void ADS::heapBuildByInsertion(std::vector<T> &A, C less = C())

heapBuildByInsertion(): A becomes a max-heap by inserting its items one at a time; O( n log n ) time

Post:

A is a max-heap