3 Replies - 8788 Views - Last Post: 28 April 2010 - 02:13 PM Rate Topic: -----

#1 lily1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 20-April 10

Loading Information from a Text File to a Binary Tree

Posted 28 April 2010 - 09:03 AM

hi everyone! Can someone tell me what is the syntax for writing/loading information from a text file to a binary tree please? I seem to have trouble figuring out how to do that. Greatly appreciated!
Is This A Good Question/Topic? 0
  • +

Replies To: Loading Information from a Text File to a Binary Tree

#2 japanir  Icon User is offline

  • jaVanir
  • member icon

Reputation: 1010
  • View blog
  • Posts: 3,025
  • Joined: 20-August 09

Re: Loading Information from a Text File to a Binary Tree

Posted 28 April 2010 - 11:55 AM

What exactly you have troubles understanding? do you know how to populate a Binary Tree?
or is the problem is reading text files?
for binary trees, you have a good link here (look for the Java section):
http://cslibrary.sta...Trees.html#java

as for reading files, Here is a tutorial:
http://www.dreaminco...wtopic27972.htm
Was This Post Helpful? 0
  • +
  • -

#3 lily1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 20-April 10

Re: Loading Information from a Text File to a Binary Tree

Posted 28 April 2010 - 12:43 PM

Thank you. But what it really is, is that the information for the tree is stored in a text file and i need to get the info from the file to populate tree...
Was This Post Helpful? 0
  • +
  • -

#4 japanir  Icon User is offline

  • jaVanir
  • member icon

Reputation: 1010
  • View blog
  • Posts: 3,025
  • Joined: 20-August 09

Re: Loading Information from a Text File to a Binary Tree

Posted 28 April 2010 - 02:13 PM

yeah I understood.
all you have to do is create a new Binary Tree object.
then read the file line by line (as demonstrated in the file reading tutorial), and add to the binary tree (as demonstrated in the Binary Tree Tutorial).
what is the data file looks like? maybe i can provide some more hints.
also, did you start writing any code?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1