cây nhị phân tìm kiếm

các anh cho em hỏi , em muốn tìm kiếm một node của cây nhị phân rồi sau đó đưa ra chi tiết vị trí của nó như cây con trái và cây con phải nhưng em làm nó chỉ hiển thị ra cây con phải của Node cần tìm kiếm
đây là code của em , thanks mọi người !

#include <iostream>
using namespace std;
typedef int item;
struct Node {
	int key;
	Node *left,*right;
};
typedef Node *tree;
int insertnode(tree &t,item x) 
{
	if(t!=NULL) 
	{
		if(t->key==x) return -1;
		else if(t->key>x) return insertnode(t->left,x);
		else if(t->key<x) return insertnode(t->right,x);
	}
	t=new Node;
	if(t==NULL) return 0;
	t->key=x;
	t->left=t->right=NULL;
}
void createnode(tree &t)
{
	int x,chucnang;
	do
	{
		cout<<"\n 1. Tiep Tuc "
		<<"\n 0. Thoat "
		<<"\n NhaP Chuc nang la : ";
		cin>>chucnang;
		if(chucnang==1)
		{
			cout<<"\n Nhap gia tri cua Node la : ";
			cin>>x;
			int check=insertnode(t,x);
			if(check==-1) cout<<"\n Node vua nhap da co ";
			else if(check==0) cout<<"\n Bo nho khong du ";
		}
		
	}while(chucnang==1);
	
}
void LNR(tree t)
{
	if(t!=NULL)
	{
	LNR(t->left);
	cout<<t->key<<"   ";
	LNR(t->right);
}

}
Node *searchnode(tree t,item x)
{
	if(t!=NULL) {
		if(t->key==x) {
			Node*p=t; return p;
			
		}
		else if(t->key>x) return searchnode(t->left,x);
		else if(t->key<x) return searchnode(t->right,x);
	} else return NULL;
}
int main()
{
	tree t;
	t=NULL;
	createnode(t);
	cout<<"\n Cay Da Duyet La : \n";
	LNR(t);
	int chucnang;
	cout<<"\n Nhap Chuc Nang : ";
	cin>>chucnang;
	switch(chucnang)
	{
		case 1 :
			{
				int x;
				cout<<"\n Nhap vao cay tim kiem ";
				cin>>x;
				Node *p=searchnode(t,x);
				if(p==NULL) cout<<"\n Ko tim thay";
				else {
				cout<<"\n Tim thay ";
				Node*s1=p->left,*s2=p->right;
				if(s1==NULL&&s2==NULL)
				{
					cout<<"\n cay khong co la ";
				}
				else {
					if(s1==NULL) cout<<"\n Nut con ben phai la : "<<s2->key;
					else if(s2==NULL) cout<<"\n Nut con ben trai la : "<<s1->key;
					else cout<<"\n 2 node con la : "<<s1->key<<" va "<<s2->key;
				}
			}
				break;
			}

	}
	return 0;
}
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?