我必须实现一个AVL树与一些给定的接口函数。到目前为止,一切似乎都很好,除了我在主函数"tree.search(3)“内调用时,它根本无法工作,只返回一个值或null。有谁知道为什么会这样吗?AVLTree: public class AVLTree implements SearchTree{
int key;this.string = _string; }
我正在实现一个二叉树。我为实现迭代器的树创建了一个Iterator类,但必须为构造函数提供树: publicIterator<Integer> iterator(AvlTreeavlTree){
//here i construct the iterator class, with the avlTree它告诉
cout << t->element << r->element << endl; //these always print as the same }我担心我的复制构造函数和operator=不能正常工作,因为它们不会将av2或av3作为av1的副本。我知道copyNodes()工作正常,因为122行的cout反映了t->元素和r->