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.
我的任务是在 C++ 中创建一个通用的二叉树,我必须使用迭代器来遍历它,而不使用 STL 容器(例如堆栈)。
这是到目前为止的所有源代码:http ://www35.zippyshare.com/v/98817061/file.html
使用递归遍历,树被完全遍历(所有值都出现在屏幕上),所以我的插入函数似乎工作正常。然而,这个迭代器似乎没有到达右侧节点(只有 1 和 2 出现,其余的没有)。任何想法为什么?