Advertisement
Guest User

Untitled

a guest
May 24th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. template<class key_type,
  2. class mapped_type,
  3. class key_compare
  4. >
  5. auto AVLTree<key_type, mapped_type, key_compare>::iterator::operator++(void) -> iterator& {
  6. if( CurrentNode != nullptr )
  7. if(CurrentNode->Right!=nullptr)
  8. while((CurrentNode=CurrentNode->Right)->Left!=nullptr)
  9. CurrentNode=CurrentNode->Left;
  10. else{
  11. while((CurrentNode->Parent!=nullptr)&&(CurrentNode->Parent->Right==CurrentNode))
  12. CurrentNode=CurrentNode->Parent;
  13. CurrentNode=CurrentNode->Parent;
  14. }
  15. // TODO: Find the next node in an in-order manner.
  16. return (*this);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement