B+ tree print elements is order

做~自己de王妃 提交于 2019-12-24 18:20:18

问题


I am trying to implement a B+ tree myself, but I want to create a method that prints what elements does the B+ tree have. If I use a traversal(in or post order) I will get also the elements in the parent nodes, therefore I will have duplicate values. Is there a way to solve this thing? Thanks


回答1:


Mark the nodes as you traverse them. Once the node is marked, it can't be traversed.



来源:https://stackoverflow.com/questions/9917715/b-tree-print-elements-is-order

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!