erappy
BAN USER
Comments (16)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
I think mirror node of a node would always be its other sibling.
i.e. if this node is a left child of its parent then the mirror node would be the right child of its parent.
so..
if(node->right->data == data) return node->left;
else if (node->left->data == data) return node->right;
else{ tmp = getMirrorNode(node->left, data); if (tmp!= null) return tmp;
tmp = getMirrorNode(node->right, data); if (tmp!= null) return tmp;
}
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
@Anonymous We are not talking about the grammer validator of automata,
- erappy July 07, 2010we are matching regular expressions