Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<class key_type,
- class mapped_type,
- class key_compare
- >
- auto AVLTree<key_type, mapped_type, key_compare>::iterator::operator++(void) -> iterator& {
- if( CurrentNode != nullptr )
- if(CurrentNode->Right!=nullptr){
- CurrentNode=CurrentNode->Right;
- while(CurrentNode->Left!=nullptr)
- CurrentNode=CurrentNode->Left;
- }
- else{
- while((CurrentNode->Parent!=nullptr)&&(CurrentNode->Parent->Right==CurrentNode))
- CurrentNode=CurrentNode->Parent;
- CurrentNode=CurrentNode->Parent;
- }
- // TODO: Find the next node in an in-order manner.
- return (*this);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement