hi i'm trying to write program to create a mirror print of a binary tree
the code is :
typedef struct Node {
int info ;
struct Node *left , *right ;
} Node ;
void swapNode ( Node *n1 , Node *n2 ) {
Node *tmp = NULL ;
tmp = n1 ;
n1 = n2 ;
n2 = tmp ;
}
void mirror ( Node *root ) {
if ( !root )
return ;
mirror ( root -> left ) ;
swapNode ( root -> left , root -> right ) ;
mirror ( root -> right ) ;
}
it is not working
can anyone tell me why ?