0
3.7kviews
Write a program to implement Binary search Tree. Show BST of the following 10, 5, 4,12, 15, 11, 3
1 Answer
1
128views
    Program for BST

    #include<stdio.h>
    #include<stdlib.h>

    struct node
    {
        int key;
        struct node *left, *right;
    };

    struct node *newNode(int item)
    {
        struct node *temp =  (struct node *)malloc(sizeof(struct node));
        temp->key = item;
        temp->left = temp->right = NULL;
        return temp;
    }

    void inorder(struct node *root)
    {
        if (root != NULL)
        {
            inorder(root->left); …

Create a free account to keep reading this post.

and 5 others joined a min ago.

Please log in to add an answer.