June 3rd, 2012, 09:15 AM
Array to Heap Tree
If I have an array, and want to make a heap tree out of it using make heap and sort heap, how would I do it? I'm struggling because I didn't take any course in data structure.
I tried googling stuff and I got to the following:
#include <algorithm> // for std::make_heap, std::sort_heap
template <typename Iterator>
void heap_sort(Iterator begin, Iterator end)
The thing is, I don't know what's the "Iterator" doing exactly and what's begin/end, how can I use arrays with the former piece of code?
Any help -in c++- will be appreciated
Tags for this Thread
Click Here to Expand Forum to Full Width