Click here to Skip to main content
15,889,861 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MFC multi-views print Pin
windyhigh5-Jul-09 22:05
windyhigh5-Jul-09 22:05 
QuestionDesign suggestion and the decorator design pattern Pin
The_Bob5-Jul-09 12:29
The_Bob5-Jul-09 12:29 
QuestionMy Heap implementation is not working...please have a look frnds.. Pin
pavarathyRock5-Jul-09 5:03
pavarathyRock5-Jul-09 5:03 
AnswerRe: My Heap implementation is not working...please have a look frnds.. Pin
Iain Clarke, Warrior Programmer5-Jul-09 6:31
Iain Clarke, Warrior Programmer5-Jul-09 6:31 
AnswerRe: My Heap implementation is not working...please have a look frnds.. Pin
harold aptroot5-Jul-09 7:54
harold aptroot5-Jul-09 7:54 
GeneralRe: My Heap implementation is not working...please have a look frnds.. Pin
pavarathyRock6-Jul-09 5:22
pavarathyRock6-Jul-09 5:22 
GeneralRe: My Heap implementation is not working...please have a look frnds.. Pin
harold aptroot6-Jul-09 5:30
harold aptroot6-Jul-09 5:30 
GeneralRe: My Heap implementation is not working...please have a look frnds.. Pin
pavarathyRock6-Jul-09 6:11
pavarathyRock6-Jul-09 6:11 
Smile | :) Smile | :)

Thanks herald for the help.....
I think my implementation is correct.

I have tried to print the heap as follows.


int main()
{
	int array[] = {14, 10, 1, 8, 7, 9, 3, 2, 4, 16};
	MyHeap h;
	h.print(array, 10);
	h.Build_Max_Heap(array, 10);
	cout<<"Initial Heap\n";
	h.print(array, 10);
	cout<<endl;

	int maxSize = 10;

	while (maxSize > 0)
	{

		cout<<array[0];
		cout<<endl;
		for (int d = 0;d < maxSize; d++)
		{
			array[d] = array[d + 1];
		}
		maxSize--;
		h.Build_Max_Heap(array, maxSize);
		//h.print(array, maxSize);
	}

	int x;
	cin<<x;
	return(0);
}


It was giving the correct output.

The main cause for this doubt is that I AM A FOOOL. I blindly believed the output given in the book.
I didn't even try to print the output and check.......

Thanks frnd thank you very much.....Thumbs Up | :thumbsup: Thumbs Up | :thumbsup: Thumbs Up | :thumbsup:



and thanks for all others for your help.
GeneralRe: My Heap implementation is not working...please have a look frnds.. Pin
harold aptroot6-Jul-09 6:44
harold aptroot6-Jul-09 6:44 
AnswerRe: My Heap implementation is not working...please have a look frnds.. Pin
David Crow5-Jul-09 11:46
David Crow5-Jul-09 11:46 
Questionint in CListBox Pin
prithaa5-Jul-09 3:47
prithaa5-Jul-09 3:47 
AnswerRe: int in CListBox Pin
Sarath C5-Jul-09 4:26
Sarath C5-Jul-09 4:26 
GeneralRe: int in CListBox Pin
prithaa5-Jul-09 4:51
prithaa5-Jul-09 4:51 
GeneralRe: int in CListBox Pin
Sarath C5-Jul-09 5:16
Sarath C5-Jul-09 5:16 
GeneralRe: int in CListBox Pin
prithaa5-Jul-09 5:53
prithaa5-Jul-09 5:53 
QuestionDialog Box won't Resize Larger Pin
Tom Hubin4-Jul-09 22:21
Tom Hubin4-Jul-09 22:21 
AnswerRe: Dialog Box won't Resize Larger Pin
PJ Arends5-Jul-09 6:52
professionalPJ Arends5-Jul-09 6:52 
QuestionMemory Issues in developing 64 bit Driver in “Windows 64 bit standard edition” ? Pin
ta_isr4-Jul-09 22:01
ta_isr4-Jul-09 22:01 
QuestionRace Condition Pin
SNI4-Jul-09 20:53
SNI4-Jul-09 20:53 
AnswerRe: Race Condition Pin
killabyte5-Jul-09 1:57
killabyte5-Jul-09 1:57 
AnswerRe: Race Condition Pin
David Crow5-Jul-09 11:53
David Crow5-Jul-09 11:53 
AnswerRe: Race Condition Pin
Alexander M.,6-Jul-09 13:52
Alexander M.,6-Jul-09 13:52 
QuestionPlease help me please Pin
aashu44-Jul-09 20:51
aashu44-Jul-09 20:51 
AnswerRe: Please help me please Pin
molesworth4-Jul-09 22:28
molesworth4-Jul-09 22:28 
GeneralRe: Please help me please Pin
aashu45-Jul-09 4:26
aashu45-Jul-09 4:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.