help!!!!!


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]

Posted by kalpol on July 27, 2001 at 16:32:01:

this is my rotate function, using nodes with parent pointers:

void rotateL (treenode*& root)
{
treenode* save = root;
root = root->rc;
root->parent = save->parent;
save->parent = root;
root->lc = save->rc;
root->lc = save;
};

the problem is in the root->parent = save->parent line. when this happens when the parent is NULL, it sets the entire root to NULL, not just the parent. ??????????????help! please help! it burns!



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]