Advertisement
Guest User

Untitled

a guest
May 24th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 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. CurrentNode=CurrentNode->Right;
  9. while(CurrentNode->Left!=nullptr)
  10. CurrentNode=CurrentNode->Left;
  11. }
  12. else{
  13. while((CurrentNode->Parent!=nullptr)&&(CurrentNode->Parent->Right==CurrentNode))
  14. CurrentNode=CurrentNode->Parent;
  15. CurrentNode=CurrentNode->Parent;
  16. }
  17. // TODO: Find the next node in an in-order manner.
  18. return (*this);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement