Implementing BST in C ( header file )
This post contains header file which contains binary search tree related function. The tree contains following functions:
Search Create new node Get the size of tree Insert Delete Print inorder, pre order and post order Starting the header file: Lets name our header file as Tree1.h.
#ifndef TREE1\_H #define TREE1\_H #include <stdio.h> #include <malloc.h> enum BOOL{false,true}; struct node { int data; struct node\* left; struct node\* right; } ; typedef struct node node; typedef enum BOOL BOOL; Defining some functions via c macros:
[Read More]