© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu
Quick Links
Easy Studies

Home Lab Exercise Data Structures Lab Exercise ProgramsImplementation of Binary Search Tree Using Abstract Data Type▼

Implementation of Binary Search Tree Using Abstract Data Type:

Algorithm Steps:
  1. Create the memory space for the root node and initialize the value to zero.
  2. Read the value.
  3. If the value is less than the root value, it is assigned as the left child of the root. Else if new value is greater than the root value, it is assigned as the right child of the root. Else if there is no value in the root, the new value is assigned as the root.
  4. The step(2) and (3) is repeated to insert the ‘n’ number of values.

Search Operation:

  1. Read the value to be searched.
  2. Check whether the root is not null
  3. If the value to be searched is less than the root, consider the left sub-tree for searching the particular element else if the value is greater than the root consider the right sub-tree to search the particular element else if the value is equal then return the value that is the value which was searched.

C Program To Implement Binary Search Tree Using Abstract Data Type
 
SLogix Student Projects
bottom