I am trying to get the value of node from the tree. tree class so far has only find which returns address of the node, but how should I get the value of the node. And I am not allowed to edit by class file.
const dataType* find(const dataType &Data) const
{
if (rootNode == NULL)
return NULL;
else
return rootNode->find(Data);
}
they is no search function and I am not allow to edit either so how could I get value from the tree node. I have seen the other example of searching but how can I do in cpp file
I’m not sure if this is what you’re asking, but simply dereferncing the pointer will give you the value: