shallysahi
BAN USER
Comments (3)
Reputation -5
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
Thank you for explaining.I appreciate your concern.tons of Thanks
- shallysahi December 04, 2012Comment hidden because of low score. Click to expand.
0
of 0 vote
@czpete425 can you please explain how do you set syccessor in followng case
4
1 6
we call ur fnct with InOrderModify(4,NULL)
it again calls InOrderModify(1,NULL)
then InOrderModify(NULL NULL) and return NULL)
prev=NULL
then InOrderModify(6,4) again return 4
4->setSucc(6) which is again wrong
Please check my suggestion..and point out mistakes(I am sure there are, I am beginner)
Node * InOrderModify(Node * pNode, Node * pPrev)
{
if (pNode == NULL)
return pPrev;
pPrev = InOrderModify(pNode->pLeft, pNode);
if (pPrev != NULL)
pPrev->pSucc = pNode;
return InOrderModify(pPrev->pRight, pNode);//prb here
}
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
cannot understand what you want in output
- shallysahi December 08, 2012