Need BinaryTree code

Hi, I need to create a binary tree with linked lists.the code captures data from input and saves them in linked lists. and i am new to programming so please put all of the code. thank you
We aren't going to do your homework. Not for free, anyway..
OK sorry
can you tell me how can i input nodes, level by level?
Do you want to make a complete binary tree (a tree where every level is full) ?
Actually you could read the input into an array, and construct a tree from it easily.. Though that might not be exactly what you need to do..
no i have to create it with linked lists.
That's not what I was asking about..

Anyway, let's start from the beginning. Can you write a node class? Can you write a function to add a node to the list?
sorry i forgot .no it's not a complete binary tree.
i can write the node structure

struct node{
node *left;
int data;
node *right};

but i don't know how to add a node to the list
Last edited on
If it isn't a complete tree, how can you enter nodes level by level? You don't know how many nodes each level will have.

Are there any properties this tree should hold? Is it a binary search tree, a heap ?
hmm i was wondering . (im new to c++)

Is a tree a type of list .. or can we add build a tree which contains a list at every node which has a string in it. I have this project which it kinda confusing.

Also i just wrote some code where i add a String into the tree but I cant keep adding the rest of the strings withing the file because i dont know how to move through the file.

Any help would be appreciated. :)

Thank you.
Topic archived. No new replies allowed.