Hi, I need to create a binary tree using linked lists like this:
struct node{
node *left;
int data;
node *right;
};
the *left points to the left child and *right points to the right child.
but when i want to input data ,every node needs name and i don't know how to do this.
Sorry for my bad English. ((-:
You can use structs inside structs. Declare a suitable struct that can hold the data you want to store in the binary tree, and then use it as the data type of the "data" member in your node struct.