NetApp Interview Question
Software Engineer / Developersvoid mirrorTree(Node **orig, Node** mir) {
if(*orig == NULL) return NULL;
*mir = (Node*) malloc (sizeof(Node))
if(*mir == NULL) return NULL;
*mir->data = *orig->data;
*mir->left = NULL;
*mir->right = NULL;
mirrorTree(&(*orig->left), &(*mir->right));
mirrorTree(&(*orig->right), &(*orig->left));
}
- Anonymous February 22, 2010