Have a tree of variable depth, and width. What is the best algorithm to find the next occurence of the node in that tree.
Next = Search to the right side of the tree ( as in breadth first search )
The selection criteria for the next occurrence of the tree is changeable in different situations.
For example, at one place, I want find the next occurrence of the node that contains the Value equal to the current node.
In another, I want to select the next value that is less than the current value.
Once the next Occurrence is found, the program can terminate and return the value or node.
5 6 9 10 7 0 5 6 8 5 6 9 5
Suppose I've a pointer to node (depth = 4, value = 5, parent = 10)... when I perform the search I want to get the pointer to the node (depth = 4, value =5, parent=0).
Say this is not there, then I want to get node(depth =1, value=5, rootNode).