answersLogoWhite

0

void del(int item) { node *parent,*location;

if(root==NULL)

{ cout<<"Tree empty");

return; }

find(item,&parent,&location);

if(location==NULL)

{ cout<<"Item not present in tree";

return; }

if(location->lchild==NULL && location->rchild==NULL)

case_a(parent,location); if(location->lchild!=NULL && location->rchild==NULL) case_b(parent,location); if(location->lchild==NULL && location->rchild!=NULL) case_b(parent,location); if(location->lchild!=NULL && location->rchild!=NULL) case_c(parent,location);

free(location);

}/*End of del()*/

void find(int item,node **par,node **loc)

{ node *ptr,*ptrsave; if(root==NULL) /*tree empty*/

{ *loc=NULL; *par=NULL; return;

}

if(item==root->info) /*item is at root*/

{ *loc=root; *par=NULL; return; } /*Initialize ptr and ptrsave*/

if(item<root->info) ptr=root->lchild;

else

ptr=root->rchild;

ptrsave=root;

while(ptr!=NULL)

{

if(item==ptr->info)

{

*loc=ptr; *par=ptrsave;

return;

}

ptrsave=ptr;

if(item<ptr->info)

ptr=ptr->lchild;

else

ptr=ptr->rchild; }/*End of while */

*loc=NULL; /*item not found*/

*par=ptrsave; }/*End of find()*/

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Can you delete the cache in your computer without harming it?

Yes. A good free program for this is Ccleaner http://www.ccleaner.com/


How do you uninstall free trail wrath of lich king?

Run the uninstall program. Or just delete the directory it is in.


Is it okay to delete the .tmp in computer?

Most of the time, yes but i strongly recommend that you use a PC cleaning program to delete teporary files. you can find tons of free cleaning programs online. I use ccleaner, but any program that can delete tempoirary files is good.


I can't delete Free Realms from my computer I already tried going into uninstall programs and deleting the file form program files that didnt work How do i delete Free Realms?

first try and delete all icons of free realms. just put in your recycle bin and delete. then from there, try going to your control panel (click start, its on the right side), and go to programs. from there, click uninstall a program, and then click the free realms installation icon, and click uninstall. then refresh your computer. -Kudos


Can you delete gemmaster mystic from your computer?

If it is a program built into Windows, most likely not but if it is a program that you installed, you can use a third party program like Geek Uninstaller. Use the free version and it will remove all traces of the program.


How to remove Trojan horse Downloader.generic6.bhs?

just delete infected dll file. Run avg free antivirus. program found by googling AVG FREE


Do you get free app after you jailbreak 2g iPod touch?

Pretty much all jailbreaking your iPod touch does is give you the installer app... Which I highly recamend you do but make sure you do the write jailbreak program or it will delete all your apps music and videos and pictures


How can you delete something that says another program is using it right now but there is no program running?

well you can try and delete using a file shredder. heres a link to one with a free trial that might do the trick. here you go. http://www.sharewareriver.com/product.php?id=4328


How do you delete the entry of a trial version of the software to reinstall it again?

Use a program called Revo Uninstaller, search for it on Cnet to get a free download.


How do you remove the virus Downloader swizzor 2 AQ?

Simply run the AVG anti-virus, which can be downloaded for free from the their official website I think you have to find all the maps called 32warn, and delete them. And you have to find the program that bring the horse in, a program installed about the day you saw the Trojan horse, and delete it. I have done it.


How do you delete a virus looking for passwords?

You'll need to download an anti-virus program as soon as possible. Downloads.com has a lot of great programs for free...check it out.


How do you write a c program for set?

Hey, I've just received a free Minecraft Giftcode! You can get one too! &gt;&gt; minecraftcodes.me &lt;&lt;