1. Can anyone tell me how i can make a function that takes an Array and sorts it with the heap sort?

2. I think that you should start a new thread for that. Furthermore, you should make an attempt before asking.

3. I have made many attempts... Because i am not sending my attempt (code) that's not mean that i haven't done anything and i want from you to solve it for me, i just want you if you can to explain me how the heap sort is because it's little bit confusing and i thing there are lots of ways to make a heap sorting of an array!!!

4. Originally Posted by ValL
I have made many attempts... Because i am not sending my attempt (code) that's not mean that i haven't done anything and i want from you to solve it for me, i just want you if you can to explain me how the heap sort is because it's little bit confusing and i thing there are lots of ways to make a heap sorting of an array!!!
Heapsort - Wikipedia, the free encyclopedia

5. Originally Posted by ValL
Ok my friend i did what you told me as first step for the exercise... And it seems to wok fine but let me sent you the part i did to check it maybe i have done something wrong!!
That's not really what I've had in mind.

With your version you can only write the array to the file the first time. For the second time (writing out the heap sorted array) you would still need a second function.

I would write the function in a way that you can use it for both writing operations. The main program would then look like
Code:
```create_array(array, n);

first_file = fopen(...);
write_array(first_file, array, n);

sort_array(array, n);

second_file = fopen(...);
write_array(second_file, array, n);```
In general a function should do one particular thing.
Your function is calculating random numbers, assigns them to the array (and assumes that the first element is already written to the file), writes them to the file and prints them to the screen. Thus you can't use it in another part of your program because it is too specific.

Bye, Andreas

6. Hi, can anyone tell my how i can create an empty priority queue with doubly link lists? I can not understand how i must do it.

Originally Posted by laserlight
I think that you should start a new thread for that. Furthermore, you should make an attempt before asking.

8. Nice help!!! Thank you

9. That's wonderful. Now can we finally let this thread die? Thanks.

10. Can you just say anything (small help) about what i have asked and do not tell me every time i ask something, to give you evidence for my attempts i have done? Is that difficult to you? Or maybe you can't just get over it that here i am not to copy anything and just paste it in my exercise so i will be done? Is just a simple thing. Say a few words of what i have asked and don't delve into everything i said to find a problem. There is not any problem my friend!! Thank you.

P.S : And yes you can finally let this thread die...

11. Originally Posted by ValL
Can you just say anything (small help) about what i have asked and do not tell me every time i ask something, to give you evidence for my attempts i have done?
No. Forcing you to come up with your own solutions makes you a good programmer.

If you just want to look at code that does what you want, use Google. You may say, "I don't want to just Google the answer, I want to learn how to program". There is no difference in getting code from us and Google.

"Give a man a fish and he feeds that night; teach a man to fish and he feeds for life"

12. You still do not understand me... I do not want code neither from you or Google. I just want a small help, like we say mmm, the priority queue does that (and don't explain it like an encyclopedia), and you should make a function which checks that...(only 2 lines of explaining, not much). Is not that difficult. Not code and not much words.

Thank you again!!!

13. and don't explain it like an encyclopedia), and you should make a function which checks that...(only 2 lines of explaining, not much). Is not that difficult. Not code and not much words.
you dont want much do you.

14. Originally Posted by http://en.wikipedia.org/wiki/Priority_queue
... a priority queue ... is like a regular queue ... data structure, but where ... each element has a "priority" associated with it.

In a priority queue, an element with high priority is served before an element with low priority.

If two elements have the same priority, they are served according to their order in the queue.

... elements are pulled in first-in first-out-order (e.g. a line in a cafeteria)

A priority queue must at least support the following operations:

- add an element to the queue with an associated priority
- remove the element from the queue that has the highest priority, and return it
Is that enough for you to go on? Try to understand and implement as best you can. If/when you get stuck or have further questions, create a new thread and clearly describe the problems you're getting or questions you have.

Hopefully, this thread will be closed to prevent further ignoring the moderators advice to start a new thread.