I made a Tree using a class
class node
{
public:
int data;
node* left;
node* right;
};
i have a doubt … if i swap two nodes.
1 -> swap(temp->left,temp->right)
2 -> swap(*temp->left,*temp->right)
what is the difference between the two ways?
how does the links with parents are affected in two ways.