RightRotate 코드 수정
해결됨
[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part3: 자료구조와 알고리즘
영상 마지막 부분에서 코드를 수정해주셨지만 수정이 안 된 코드도 있어서 다른 수강생분들께서 참고하시라고 올립니다. Rookiss님이 올려놓으신 샘플 코드에는 수정본으로 올라와있습니다. void BinarySearchTree::RightRotate(Node* y) { Node* x = y->left; y->left = x->right; if (x->right != _nil) x->right->parent = y; x->parent = y->parent; if (x->parent == _nil) _root = x; else if (y == y->parent->left) y->parent->left = x; else y->parent->right = x; x->right = y; y->parent = x; }
- 기술면접
eniak
댓글 2
좋아요 7
조회수 414





