Hi all,
Say i have 2 nodes of a tree.
struct tree{
int data;
tree* left;
tree* right;
};
NODE1
data = 3;
left = NULL;
right = NULL
and
NODE2
data = 6;
left = NULL;
right = NULL
How do i say Node 2 if the left link of node 1 so it creates the start of a tree.
So it looks like
NODE1
/ \
NODE2 NULL
I thought I could say node1->left = &node2; // left = the address of node 2.
Is that right?
Thanks