T
Travis
I have a tree of pointers and I need the ability to search the tree
for a specific node. The problem is I can't provide that pointer for
the node I'm looking for as criteria. The only critieria I can provide
is a node that is the same and will == true.
So naturally this would work if my tree was not of pointers but of
objects. Since it's of pointers, it compares my node criteria against
every node in the tree and the memory addresses aren't the same so
it's not found.
If I force the tree to deference the node before comparing it works
but then what if my tree was of objects, not pointers, dereferencing
and object would blow up right?
Any suggestions, solutions?
for a specific node. The problem is I can't provide that pointer for
the node I'm looking for as criteria. The only critieria I can provide
is a node that is the same and will == true.
So naturally this would work if my tree was not of pointers but of
objects. Since it's of pointers, it compares my node criteria against
every node in the tree and the memory addresses aren't the same so
it's not found.
If I force the tree to deference the node before comparing it works
but then what if my tree was of objects, not pointers, dereferencing
and object would blow up right?
Any suggestions, solutions?