void rbnode_traverse(rb_node * node, opr * op) { if (!node) return; rbnode_traverse(node->left, op); op(node->object); rbnode_traverse(node->right, op); }
/*! * Traverse a red-black sub-tree * * \param node The sub-tree root * * \param op The operation to perform on each object in the sub-tree */ void rbnode_traverse ( rbnode_t * node, rb_operation op ) { if (!node) return; rbnode_traverse(node->left, op); if (op) (op)(node->object); rbnode_traverse(node->right, op); }
/*! * Traverse a red-black tree * * \param tree The tree * * \param op The operation to perform on every object of the tree (according to * the tree order) */ void rbtree_traverse ( rbtree_t * tree, rb_operation op ) { rbnode_traverse(tree->root, op); }
void rbtree_traverse(rb_tree * tree, opr * op) { rbnode_traverse(tree->root, op); }