Basics-Wrapup

View on GitHub

Binary Search Tree

Tree represents the nodes connected by edges.

Binary_tree

Important Terms

Following are the important terms with respect to tree.

Binary Search Tree Representation

a Tree where A node’s left child must have a value less than its parent’s value and the node’s right child must have a value greater than its parent value.
Binar_Search Tree Example

The code to write a tree node would be similar to what is given below. It has a data part and references to its left and right child nodes ,also you can add a key to it.

    struct node {
        int data;
        struct node *leftChild;
        struct node *rightChild;
    };

In a tree, all nodes share common construct.

BST Basic Operations

The basic operations that can be performed on a binary search tree data structure, are the following −