BST/bst_codeschool.cpp
// To insert data in BST, returns address of root node
To insert data in BST, returns address of root node
To insert data in BST returns address of root node
BstNode* Insert(BstNode* root, int data)
{
	if (root == NULL)
	{	
		root = GetNewNode(data);
	}
	else if (data <= root->data)
	{
		root->left = Insert(root->left, data);
	}
	else
	{
		root->right = Insert(root->right, data);
	}
	return root;
}
BstNode * Insert ( BstNode * root , int data ) { if ( root == NULL ) { root = GetNewNode ( data ) ; } else if ( data <= root -> data ) { root -> left = Insert ( root -> left , data ) ; } else { root -> right = Insert ( root -> right , data ) ; } return root ; }
To insert data in BST, returns address of root node
To insert data in BST returns address of root node
// empty tree // if data to be inserted is lesser, insert in left subtree. // else, insert in right subtree.