Search Function

function search returns a boolean values, it accepts 2 parameters the
root node and the search value.
Search function

create a boolean variable found & by default it is set to false. create
a while loop to traverse the tree to search the value in the tree.. here
conditions to be checking are whether root is not null and search value
is not false. create a variable  rval to get the value of the root.
Search function

check whether the search value is less than root value, if so traverse
to the left side.
Search function

check whether if the search value is greater than the root value,
traverse to the right side of the tree.
Search function

if search value is found (when bool variable found is true) it breaks.
Search function

once the value is found,  pass the root and the value to the search
function and assign it to the variable found.
Search function

Return the value of variable found.