Untitled

mail@pastecode.io avatar
unknown
c_cpp
a year ago
475 B
1
Indexable
Never
#include<iostream>
using namespace std;
class node{

	public:
	int data;
	node * left, *right;
	int lth,rth;//if th=1 then it thread
	
	node(int x){
		data=x;
		lth=1;
		rth=1;
	}
class TBT{

public:
node*root, *dummy;
	TBT(){

		root=NULL;
		dummy=new node(-1);
		dummy->rth=0;
		dummy->lth=1;
		dummy->left=dummy;
		dummy->right=dummy;
	}
	
	void insertnode();
	void insert(node *,node *);//bst
	void preorder();
};
void TBT::insertnode()
{
	node *newnode;
	int data;

}