I have a Tree class that has a nested private Node class.
I wrote a method (Search(T elem)
) that searches if the element given as parameter exists in the tree and sends a boolean.
However my problem is that this method only sends true if the element exists in the first branch of my tree and if not, it sends false. I must have mistaken somewhere in recursive calls.
for example, here in main i call search('C')
and I get false although I should get true because C is in the second branch of my tree.
P.S. : Also I should mention that in this class, copy operator and constructor must be disabled and i can not use anything but raw pointer (no vector or smart pointers).
Thank you in advanced.