Posts

Showing posts with the label create_node

C++: Binary search tree(bst)

//============================================================================ // Name        : Tree.cpp // Author      : Parashar // Version     : 1.00 // Copyright   : Do not try this at home ;p // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> using namespace std; class node { public:     int data;     node *left;     node *right; }; class tree { public:     node *root,*n; public:     tree();     void create();     void insert(node*,node*);     void inorder(node*);     void preorder(node*);     void postorder(node*);     void search(node*); }; tree::tree() {     root=NULL; } void...