Posted by quyen on July 29, 2001 at 21:41:53:
In Reply to: Re: TEST QUESTION ABOUT PARENT POINTER posted by quyen on July 29, 2001 at 21:29:01:
: void leftToRightRotate (treeNode * & root)
: {
: treeNode * psave = root->psave;
: treeNode * save = root;
: root = save->leftChild;
: save->leftChild = root->rightChild;
: root->rightChild = save;
: root->parent = psave->parent;
: save->parent = root;
: save->leftChild->parent = save;
: }
: //3 parent pointers are updated
corrections the first line should be:
treeNode * psave = root->parent;