I have an AVLTREE class, and inside it an inner class which is an iterator. The iterator is instanciated by the user request only. Suppose I have this code:
tree.add(10);
tree.add(6);
tree.add(19);
Iterator<Integer> it1 = tree.iterator();
System.out.println(it1.next());
System.outrintln(it1.next());
tree.delete(10);
System.outrintln(it1.next());
the sysrem will print "null" , althogh the tree has another value: 19. How do I approach the instance of a specific Iterator and change its current node to be the successor of the deleted node in such cases?
Thanks!
it1.remove()ifit1.next() == 10