Ive been trying to implement a simple search method for my BST but its always returning false, and when i use cout statements to see where its going, it only ever goes in one case(the < one)! ive tried many variations, but maybe ive been staring at it for too long. hoping a new pair of eyes might shed some light. thanks.
its searching for the customer based off of first and last name, ive overloaded the comparison operators (and checked that they work) to work for the customer objects.
oh godness, youre right about the recursive part. i was so fixated on trying to get it to just work... but even without recursion, shouldnt this work? or is it because its not recursive that it isnt working? :\
binary search....assuming the root is not null, if the target is greater than the root, go right, if less than, go left etc and keep going until you find it or atleast reach the point where it should be.
just as a side note (i realize ive left this out) each customer has a first name/last name and ive overloaded the comparison operators to compare them alphabetically, last name first.