#include<iostream>
#include<string>
using namespace std ;
class LinkedList
{
public:
class Node
{
public:
int data;
Node *left ;
Node *right ;
Node(int d)
{
data = d ;
left = NULL ;
right = NULL;
}
};
Node *root ;
public:
LinkedList()
{
root = NULL ;
}
~LinkedList()
{
}
void insertion (int data )
{
Node*node = new Node(data) ;
if ( root == NULL )
{
root = node ;
node->left= NULL;
node->right = NULL;
}
else
{
Node *temp = root;
while( temp != NULL )
{
if (node ->data <= temp->data )
{
temp = temp->left;
}
else
{
temp = temp->right;
}
}
if (node->data <= temp->data )
#include<string>
using namespace std ;
class LinkedList
{
public:
class Node
{
public:
int data;
Node *left ;
Node *right ;
Node(int d)
{
data = d ;
left = NULL ;
right = NULL;
}
};
Node *root ;
public:
LinkedList()
{
root = NULL ;
}
~LinkedList()
{
}
void insertion (int data )
{
Node*node = new Node(data) ;
if ( root == NULL )
{
root = node ;
node->left= NULL;
node->right = NULL;
}
else
{
Node *temp = root;
while( temp != NULL )
{
if (node ->data <= temp->data )
{
temp = temp->left;
}
else
{
temp = temp->right;
}
}
if (node->data <= temp->data )