/BSTSearch

Implement a C program to construct a Binary Search Tree, to search for an element in BST and to display the elements in the tree using Inorder traversals. Binary Search tree is a binary tree in which each internal node x stores an element such that the element stored in the left subtree of x are less than or equal to x and elements stored in the right subtree of x are greater than or equal to x. This is called binary-search-tree property. Input and Output Format: Refer Sample Input and Output for formatting specifications. [All text in bold corresponds to input and the rest corresponds to output] Sample Input and Output 1: Enter the element to be inserted in the tree 1 Do you want to insert another element? yes Enter the element to be inserted in the tree 2 Do you want to insert another element? yes Enter the element to be inserted in the tree 3 Do you want to insert another element? yes Enter the element to be inserted in the tree 4 Do you want to insert another element? no Inorder Traversal : The elements in the tree are 1 2 3 4 Enter the element to be searched 6 6 not found Sample Input and Output 2: Enter the element to be inserted in the tree 1 Do you want to insert another element? yes Enter the element to be inserted in the tree 2 Do you want to insert another element? yes Enter the element to be inserted in the tree 3 Do you want to insert another element? yes Enter the element to be inserted in the tree 3 Do you want to insert another element? no Inorder Traversal : The elements in the tree are 1 2 3 4 Enter the element to be searched 3 3 found

Primary LanguageC

Stargazers