Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have an assignment bugging me. It's about a heap but not minHeap or maxHeap. It's average heap. Detailed explanation is here: http://homes.ieu.edu.tr/ocagirici/CE221/assignment4.pdf I am asking for an idea, how can i create that data structure.
Posted
Comments
Philippe Mori 11-Dec-13 23:17pm    
The explanation in the document are not complete so you should ask your professor to explain it in more details. How do you reject a number? Does the number are processed in order? What is the meaning of the 2 decimal places? Do you have to find best solution or any solution? How do you decide the geometry of the head. Should it be as flat as possible and filled from the left?

One guess would be to use same algorithm as min head (or max head) but replace the condition with that new one and if a number cannot be inserted then simply reject it.

What is weird is that as far as I can tell, if item are added one by one, then the optimum head would be very different each time... thus maybe the best solution would be to simply try all permutations...

1 solution

Perhaps, before you try to get us to do your homework for you you might want to sit down and think about how it makes you look when your "question" to us consists of "here is my homework question - go look at it and give me an idea".

For my perspective, it looks like someone too lazy to even try to help himself, much less help us to help him in any way.

So, I decline to follow your link and look at your homework question for you. If you want help from us, I would suggest that you look at the question set for you, and actually try to do it yourself. If you get stuck on a specific part of it, then feel free to ask for help with that, but do try to make it easy for us.

We don't do your homework. Try it yourself, you may find it is easier than you think.
 
Share this answer
 
Comments
Member 10238389 11-Dec-13 16:44pm    
If you look at the hangind date it says tomorrow. You're prejudicing. I've been thinking for this assignment over 3 days. My last choice was coming here and asking you guys for help. And here we are. I am a software engineering student i am not a lazy person. If asking for an idea is being lazy than well everyother person in world is a lazy person or a liar. thank you anyways and i hope you could change your attitude
OriginalGriff 11-Dec-13 16:52pm    
Take a step back, put yourself in our position and read your question.

Does that read like a question from someone who has tried to make it easy for the answerer, or easy for the questioner?
Does it read like a question from someone who has tried to do it, and shown what problem he has with the problem?

Or does it read like someone you just posts a link to his homework question and can't be bothered to do anything to help anyone who might answer?

As I said: try it. Ask us if you have a specific problem, but we aren't here to do your work for you! :laugh:
[no name] 11-Dec-13 19:47pm    
Griff is quite correct. You are providing a link to your homework I assume and then asking for ideas about how to go about solving it. This is not very respectful of others. Just thinking for 3 days is not going to get you anywhere as you have proved. Do some work.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900