I made a binary tree int the following way :
typedef struct BstNode {
int data;
struct BstNode *left;
struct BstNode *right;
}Tnode;
typedef Tnode *BST;
BST InsertNode(BST tree,int info){
if(tree==NULL){
tree=MakeNode(info);
return tree;
}
else if (InfoGreater(info,tree->data)==0){
tree->left= InsertNode(tree->left,info);
}
else {
tree->right=InsertNode(tree->right,info);
}
tree;
}
//info greater only checks what value is bigger and returns 1 if info is greater 0 in other cases
and i wanna print it . I really have no idea about how to do that but i wish i could print it like
5
3 7
2 4 6 8
Also it is necessary that the fucntion calls only the generic tree root. like
void print_BTS(BTS tree){
...
}
I googled around and on this site but i really can't find anything or what i found it's wayyy tooo complicated ways to implement it . I found something but not in the C lang only c# or java and so on .