Search:
Type: Posts; User: R1111
Search:
Search took 0.01 seconds.

hmm why did you do "a+size" ?
How about this? does it seem right?
#include <iostream>
#include <algorithm>
void heap_sort(int* begin, int* end)

I don't know how to deal with vectors, first encounter! I'm trying to use what I'm somewhat familiar with. I'll try to learn vectors soon.
But now I still don't get how I'll get push_heap to work...

so would it be something like this?
void add_value (double* begin, double* end)
{
push_heap(begin, end);
}
int main ()
{

Assuming that I defined a bigger array, and only a few values are associated with the first few slots. How can I add values using push_heap, if there's no equivalent to v.push_back(value) ?

well, it's confusing, there's this "v.push_back(value)" with vectors, but what's the equivalent if I'm using an array instead of a vector?

I want to add values to my array, push_heap should do it, I don't know how to use it. The example on the reference page uses vectors and "auto." Do you know what to do/how to use push_heap in a...

Thank you laserlight and ahoodin,
now I've used make_heap and sort_heap, like this:
#include <iostream>
#include <algorithm>
void heap_sort(int* begin, int* end)
{
...

Hello,
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...

Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.
Featured
