src/classify/kdtree.cpp
void Walk(KDTREE *tree, void_proc action, void *context, KDNODE *sub_tree, int32_t level) {
  (*action)(context, sub_tree->Data, level);
  if (sub_tree->Left != nullptr) {
    Walk(tree, action, context, sub_tree->Left, NextLevel(tree, level));
  }
  if (sub_tree->Right != nullptr) {
    Walk(tree, action, context, sub_tree->Right, NextLevel(tree, level));
  }
}
/*---------------------------------------------------------------------------*/
/**
 * Walk a tree, calling action once on each node.
 *
 * Operation:
 *   This routine walks through the specified sub_tree and invokes action
 *   action at each node as follows:
 *       action(context, data, level)
 *   data  the data contents of the node being visited,
 *   level is the level of the node in the tree with the root being level 0.
 * @param tree  root of the tree being walked.
 * @param action  action to be performed at every node
 * @param context  action's context
 * @param sub_tree  ptr to root of subtree to be walked
 * @param level  current level in the tree for this node
 */
Walk a tree, calling action once on each node.
Operation:
This routine walks through the specified sub_tree and invokes action
action at each node as follows:
action(context, data, level)
data  the data contents of the node being visited,
level is the level of the node in the tree with the root being level 0.
@param tree  root of the tree being walked.
@param action  action to be performed at every node
@param context  action's context
@param sub_tree  ptr to root of subtree to be walked
@param level  current level in the tree for this node
Walk a tree calling action once on each node . Operation : This routine walks through the specified sub_tree and invokes action action at each node as follows : action ( context data level ) data the data contents of the node being visited level is the level of the node in the tree with the root being level 0 . @param tree root of the tree being walked . @param action action to be performed at every node @param context action ' s context @param sub_tree ptr to root of subtree to be walked @param level current level in the tree for this node
void Walk(KDTREE *tree, void_proc action, void *context, KDNODE *sub_tree, int32_t level) {
  (*action)(context, sub_tree->Data, level);
  if (sub_tree->Left != nullptr) {
    Walk(tree, action, context, sub_tree->Left, NextLevel(tree, level));
  }
  if (sub_tree->Right != nullptr) {
    Walk(tree, action, context, sub_tree->Right, NextLevel(tree, level));
  }
}
void Walk ( KDTREE * tree , void_proc action , void * context , KDNODE * sub_tree , int32_t level ) { ( * action ) ( context , sub_tree -> Data , level ) ; if ( sub_tree -> Left != nullptr ) { Walk ( tree , action , context , sub_tree -> Left , NextLevel ( tree , level ) ) ; } if ( sub_tree -> Right != nullptr ) { Walk ( tree , action , context , sub_tree -> Right , NextLevel ( tree , level ) ) ; } }
Walk a tree, calling action once on each node.
Walk a tree calling action once on each node .