Here is the code of my binary tree can any one plzzz write the delet function for it.....
i tried my best but.....

#include<iostream>
#include<stdio.h>
#include<conio.h>
#include<Windows.h>
#include<stdlib.h>

using namespace std;

struct st
{
	int marks;
	st *left;
	st *right;
};

struct st * create()
{
	struct st *p=new st;
	return p;
}

void read(struct st *cur)
{
	cout<<"Enter The Marks :";
	cin>>cur->marks;
	fflush(stdin);
}

void display(struct st *cur)
{
	cout<<"Marks :"<<cur->marks<<endl;
}

void insert(struct st **root,struct st *cur)
{
	struct st *p=*root;
	
	if(*root==NULL)
	{
		*root=cur;
		cur->left=NULL;
		cur->right=NULL;
	}
	else
	{
		if(p->marks>cur->marks)
			insert(&p->left,cur);
		else if(p->marks<cur->marks)
			insert(&p->right,cur);
	}
	
}

void display_lvr(struct st *root)
{
	if(root!=NULL)
	{
		display_lvr(root->left);
		display(root);
		display_lvr(root->right);
	}
}

void display_lrv(struct st *root)
{
	if(root!=NULL)
	{
		display_lvr(root->left);
		display_lvr(root->right);
		display(root);
	}
}

bool search(struct st *root,int n)
{
	if(root==NULL)
		return false;
	else
	{
		if(root->marks==n)
			return true;
		else if(root->marks<n)
			search(root->right,n);
		else
			search(root->left,n);
	}
	
}



void display_vlr(struct st *root)
{
	if(root!=NULL)
	{
		display(root);
		display_lvr(root->left);
		display_lvr(root->right);
	}
}

struct st * find_parent(struct st *root,int n)
{
	if(root==NULL || root->marks==n)
		return NULL;
	else
	{
		struct st *p;
		while(root!=NULL)
		{
			p=root;
			if(root->marks>n)
				root=root->left;
			else if(root->marks<n)
				root=root->right;
			if(root->marks==n)
				return p;
		}
	}
}

struct st * find_brother(struct st *root,int n)
{
	if(root==NULL || root->marks==n)
		return NULL;
	else
	{
		struct st *t;
		t=find_parent(root,n);
		if(t->left->marks==n)
			return t->right;
		else
			return t->left;
	}
}



void main()
{
	char option;
	struct st *root=NULL;
	struct st *cur;
	while(1)
	{
		cout<<"***Tree***\n"<<endl;
		cout<<"1-Insert"<<endl;
		cout<<"2-Search"<<endl;
		cout<<"3-Delete"<<endl;
		cout<<"4-Dispay in LVR order"<<endl;
		cout<<"5-Dispay in VLR order"<<endl;
		cout<<"6-Dispay in LRV order"<<endl;
		cout<<"7-Quit\n"<<endl;
		cout<<"Select An Option :";
		option=getche();
		
		if(option=='1')
		{
			system("cls");
			cur=create();
			read(cur);
			insert(&root,cur);
			
		}
		else if(option=='2')
		{
			system("cls");
			int n;
			cout<<"Enter The Number to Search:";
			cin>>n;
			fflush(stdin);
			if(search(root,n))
				cout<<"\nNode Exists"<<endl;
			else
				cout<<"\nNot Doesn't Exists"<<endl;
		}
		else if(option=='3')
		{
			system("cls");
			
		}
		else if(option=='4')
		{
			system("cls");
			display_lvr(root);
			
		}
		else if(option=='5')
		{
			system("cls");
			display_vlr(root);
			
		}
		else if(option=='6')
		{
			system("cls");
			display_lrv(root);
		}
		else if(option=='7')
		{
			system("cls");
			break;
		}
		else
		{
			cout<<"\n\nWrong Option\n\n"<<endl;
		}
		
		
	}
}

First suggestion:
Use switch instead of all those ifs,else ifs...

Second suggestion:
Don't use system!

Third suggestion:
Show what you have done so far for delete and why you have failed to finish it, and we'll definitely help you.

First suggestion:
Use switch instead of all those ifs,else ifs...

Second suggestion:
Don't use system!

Third suggestion:
Show what you have done so far for delete and why you have failed to finish it, and we'll definitely help you.

Yeah i know else if is shit

why donnt use system???

i hav coded a bit but couldn't figure it out can u plz give it a shot

For use of system please read this link

For delete, we are not going to do any coding for you unless you show some effort. Don't ask "give me the code", it'd be better for you if you try and post your code and tell us which part of it fails on you and you'll get help you need.

Good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.