Sunday 21 May 2017

DSA Lab 7: Binary Search Tress

Task:

We have implemented binary search algorithm in previous labs. We we have to implement the binary search tree class "MyBinarySearchTree". Your class should contain all necessary functions in addition to these functions:

  • insert(int x);        //it will create new node of integer 'x' and insert new node in the tree
  • search(int x);        //it will search integer 'x' in the BST (binary search tree) and return the True or False
  • displayPath(int x);        //it will search integer 'x' in the BST (binary search tree) and return the complete path to it from root node this integer
Note: Obviously you have to implement "MyNode" class for BST implementation.

No comments :

Post a Comment