How can I fill a binary tree from a file with .in extension

I'm asked to fill a binary tree from file like lab.in . I don't know what type it is and I don't how I can make it read the data in it and call inset function to fill the tree. Please help.

This is lab.in
52 3.2
34 3.4
32 2.9
52, 34, and 32 are the keys to determine the nodes position in the tree. 3.2 , 3.4 and 2.9 are data stored in the nodes.

Last edited on
This is just the simple text file. Are you having problems with reading it or with putting things into a binary tree?
Hi,

I am also having this problem where i need to add Strings into a tree list. I managed to get the program to read the file but i dont understand how to go through the file reading one string at a time and inserting it into the tree.

I have 1000 words and only can use a tree. I tried googleing it but could not find the right answer for my problem. IF someone can atleast point me in the right direction on how to iterate through the file it would be awesome. :)

Thank you.
Topic archived. No new replies allowed.