When i run my program in Unix, there are no warning and error,but when i run it, there are something called segmentation error, can any one help me to see what my problem is....thanks


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//#include"BinarySearchTree.h"
int count=0,max=0,hight=0;

typedef struct _bst{
char key[30];
struct _bst *left_child, *right_child;
}bst;

bst *search(bst *root,char name[30]);
bst *insert(bst *root,char name[30]);
bst *Delete(bst *root,char name[30]);
bst *FindMin(bst *root);
void print(bst *root);
int GetHeight(bst *root);


int main(int argc,char *argv[]){

bst *node;
char operation,name[30];

while(1){
scanf("%c",&operation);
scanf("%s",name);
switch (operation){
case 'i':
node=insert(node,name);
break;
case 's':
if (search(node,name) == NULL){
printf("True!");
printf("%s can be find\n",name); }
else
printf("False\n");
break;
case 'h':
count=max=0;
printf("%d\n",GetHeight(node));
break;
case 't':
hight=0;
print(node);
break;
case 'd':
Delete(node,name);
break;
case 'q':
exit(1);
default:
printf("Operation character error, end the program\n");
exit(1);
}
}

return 0;
}


bst *insert(bst *root,char name[30]) {
int side=strcmp(name,root->key);
bst *ptr,*temp=search(root,name);
if (temp || !(root)){
ptr=(bst*)malloc(sizeof(*root));
if (ptr== NULL){
printf("The memory is full\n");
exit(1);
}
strcpy(ptr->key,name);
ptr->left_child=ptr->right_child = NULL;
if (root)if (side<0) temp->left_child =ptr;
else temp->right_child=ptr;
else root = ptr;
}
return root;
}

bst *Delete(bst *root,char name[30]){
int side=strcmp(name,root->key);
bst *TmpCell;
if(root== NULL )
printf( "Element not found\n" );
else
if( side<0) /* Go left */
root->left_child = Delete(root->left_child,name );
else
if( side>0) /* Go right */
root->right_child = Delete( root->right_child ,name);
else /* Found element to be deleted */
if( root->left_child && root->right_child ) /* Two children*/
{
/* Replace with smallest in right subtree */
TmpCell = FindMin( root->right_child );
strcpy(root->key , TmpCell->key);
root->right_child = Delete( root->right_child,root->key );
}
else /* One or zero children */{
TmpCell = root;
if( root->left_child == NULL ) /* Also handles 0 children*/
root = root->right_child;
else if( root->right_child == NULL )
root = root->left_child;
free( TmpCell );
}
return root;
}

bst *search(bst *root,char name[30]){
int side=strcmp(name,root->key);
if (!root) return NULL;
if (side == 0) return NULL;
if ((side<0) && (root->left_child))
return search(root->left_child,name);
if ((side>0) && (root->right_child))
return search(root->right_child,name);
return root;
}


bst *FindMin(bst *root){
if( root == NULL )
return NULL;
else if( root->left_child == NULL )
return root;
else
return FindMin( root->left_child );
}

int GetHeight(bst *root){
//static int count =0,max=0; global variables
if (root){
count++;
if (count > max)
max=count;
GetHeight(root->left_child);
GetHeight(root->right_child);
count--;
}
return max;
}


void print(bst *root) {
int i;
if (root){
hight++;//hight is a static variable
print(root->right_child);
for(i=0;i<hight;i++)
printf("\t");
printf("%s",root->key);
print(root->left_child);
hight--;
}
}