Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对于二叉搜索树,我只能访问根节点,而我正在尝试编写一个递归方法来挖掘它的左节点。
例如,
root.left();
变成
root.left().left();
接着,
你知道这是怎么回事..有没有一种递归的方式来改变/添加到变量?
像这样的东西?
Node node = root; while (someCondition) { node = node.left(); // do something with the node }