Balanced binary tree 扩展,增加get-next函数
1、去掉is_left_child
2、
else if (cmp >= 0)
{
if (node->right)
{
node = node->right;
} else {
if (NULL != prenode) {
return prenode->data;
} else {
return NULL;
}
}
}
本文介绍了一种平衡二叉树的扩展方法,重点在于新增get-next函数的实现细节,该函数用于寻找节点的下一个元素。文中通过一系列条件判断实现了在没有左子节点的情况下如何返回下一个元素。
2026

被折叠的 条评论
为什么被折叠?



