Tree
a tree is a widely used data structure that simulates a hierarchical tree structure with a set of linked nodes.
A tree can be defined recursively (locally) as a collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of nodes (the "children"), with the constraints that no node is duplicated. A tree can be defined abstractly as a whole (globally) as an ordered tree
Menu based program for tree operation (Add,Delete,inorder,preorder,postorder print).
#include<stdio.h>
#include<conio.h>
/* Tree Implementation
By Girfa
Do not use it on any other website
*/
typedef struct st_tree
{
struct st_tree *left;
int data;
struct st_tree *right;
}tree;
/* Function Prototype */
tree* create(int);
void insert(int n,tree **);
void inorder(tree *);
void preorder(tree *);
void postorder(tree*);
void del(int,tree **);
void main()
{
tree *root=NULL;
int n,s,opt;
a tree is a widely used data structure that simulates a hierarchical tree structure with a set of linked nodes.
A tree can be defined recursively (locally) as a collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of nodes (the "children"), with the constraints that no node is duplicated. A tree can be defined abstractly as a whole (globally) as an ordered tree
Menu based program for tree operation (Add,Delete,inorder,preorder,postorder print).
#include<stdio.h>
#include<conio.h>
/* Tree Implementation
By Girfa
Do not use it on any other website
*/
typedef struct st_tree
{
struct st_tree *left;
int data;
struct st_tree *right;
}tree;
/* Function Prototype */
tree* create(int);
void insert(int n,tree **);
void inorder(tree *);
void preorder(tree *);
void postorder(tree*);
void del(int,tree **);
void main()
{
tree *root=NULL;
int n,s,opt;