Performs a depth-first traversal of the tree, returning all matching leaf nodes.
A depth-first search for matching leaves, where the candidate child leaves of a parent node are randomly shuffled, but with nodes with higher weight being given a higher probability of being ordered earlier.
A depth-first search for matching leaves, where the candidate child leaves of a parent node are randomly shuffled, but with nodes with higher weight being given a higher probability of being ordered earlier. This is basically a mix between randomDepthFirst and weightedDepthFirst.
The actual algorithm can best be though of as a random sample from a set of weighted elements without replacement. The weight is directly proportional to its probability of being sampled, relative to all the other elements still in the set.
A depth first search for matching leaves, randomly choosing the order of child candidate nodes to traverse at each step.
A depth first search for matching leaves, randomly choosing the order of child candidate nodes to traverse at each step. Since it is depth-first, after a node is chosen to be traversed, all of the matching leafs that descend from that node are traversed before moving onto the node's sibling.
A depth-first search for matching leaves, where the candidate child nodes for a given parent node are traversed in reverse order of their annotations.
A depth-first search for matching leaves, where the candidate child nodes for a given parent node are traversed in reverse order of their annotations. This means that if we have multiple valid candidate children, we will traverse the child with the largest annotation first.