Right now I binary tree and i want to get the max value out of it. Considering how it has both string and int values, it is ordered by alphabetical order. Everything is working properly all the inserts, search, delete etc. For now all we need to know is that here I have my tree.
typedef struct node
{
char *name;
int count;
struct node *l, *r;
}*link;
How can I make a simple function that finds what is the highest count in the tree. Like I can have 20 nodes in the tree and suppose the highest count is 10 and there are 3 nodes with the highest count. It doesn't matter how many there are with 10 the highest count, I just want the function to return 10. A function like.
int maxValue(link head)
{
//the help i need with
}
I've looked up online and tried some examples like the inorder and all of the different funtions but most of them just placed all values from left node to the most right one in order so it didnt really help me find the maximum number in the tree because mine is not organized from smallest to largest numbers.
countvalue... - Eugene Sh.