Skip to main content

Posts

Showing posts from April, 2022

Binary Search Tree Operations

Binary Search Tree Operations   //Main File #include<stdio.h> #include<stdlib.h> #include "tree.h" NODE * create(NODE *root); NODE * insert(NODE *root,int n); NODE *search(NODE * root, int n); void display(); void preorder(NODE * root); void inorder(NODE * root); void postorder(NODE * root); NODE * deletebst(NODE *root, int n); int Node_count(NODE *root); int Leaf_count(NODE *root); NODE *treecopy(NODE *root); int comparebst(NODE *root, NODE *root1); int sumOdd(NODE *node); int sumEven(NODE *node1); void mirror(NODE *root); int smallest(NODE * root); int largest(NODE * root); void main() { NODE *root=NULL, *root1=NULL;     int n, num, osum, esum, choice; printf("\t\t>>Operations of Binary Search Tree<<\n\n");     printf("\t\t\t>>First Create BST<<\n");             //CREATE     root = create(root);     root1 = create(root1); do { printf("\n\n1.INSERT"); printf("\n2.SEARCH"); prin