Binary search tree

3 flashcards · Computer Science · by Sureshkumar Ramanujam

  1. Whether binary search tree can be used for sorting?

    Yes

  2. Whether the given tree is a binary search tree?

    No, because node 2 should be the right child of 1.

  3. Write a c code for inserting an element 15 when there is a root node 20

    void insert(int X, Tree T) { T=malloc(sizeof(struct bst); if(X<T->data) { T->left=insert(X,T->left); } }