#include<stdio.h>
struct binarysearchtree
{
int data;
struct binarysearchtree* left;
struct binarysearchtree* right;
};
typedef struct binarysearchtree* tree;
void tree_free(tree T)
{
if (T==NULL)
return;
else
{
tree_free(T->left);
tree_free(T->right);
free(T);
}
}
This is a brilliant collection of most of the algorithms that you can find recurring from interview to interview. Amazing work! :)
ReplyDelete- NK
i believe it should be:
ReplyDeletevoid tree_free(tree *T)