typedef struct Node {
Datatype data;
struct Node *leftChild; struct Node *rightChild; }BiTreeNode;
void Initiate(BiTreeNode **root) {
*root = (BiTreeNode * )malloc(sizeof(BiTreeNode)); ( *root) -> leftChild = NULL; ( *root) -> rightChild = NULL; }
BiTreeNode *InsertLeftNode(BiTreeNode *curr,Datatype x) {
BiTreeNode *s, *t;
if(curr == NULL) return NULL;
t = curr -> leftChild;
s = (BiTreeNode * )malloc(sizeof(BiTreeNode)); s -> data = x; s -> leftChild = t;
s -> rightChild = NULL;
curr -> leftChild = s; return curr->leftChild; }
BiTreeNode *InsertRightNode(BiTreeNode *curr, Datatype x) {
BiTreeNode *s, *t;
if(curr == NULL) return NULL;
t = curr ->rightChild;
s = (BiTreeNode *)malloc(sizeof(BiTreeNode)); s -> data = x;
s -> rightChild = t; s -> leftChild = NULL;
curr -> rightChild = s; return curr -> rightChild;
}
BiTreeNode *DeleteLeftTree(BiTreeNode * curr) {
if(curr == NULL || curr -> leftChild == NULL) return NULL;
// Destroy(&curr -> leftChild); curr -> leftChild = NULL; return curr; }
BiTreeNode *DeleteRightTree(BiTreeNode *curr) {
if(curr == NULL || curr -> rightChild == NULL) return NULL;
// Destroy(&curr -> rightChild); curr -> rightChild = NULL; return curr; }