File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Linked-list, binary tree?

 
Bill Norton
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm wanting to read in a flat text file and then store this information in memory while my app runs. Everyonce in a while I will need to re-write this data back onto the disk. I am not concerned about reading and writing the file(this seems pretty straight forward) but rather how to store this data in a way that is efficient and retrival time is quick. Also, the first and second column would always be different and I would need to be able to get one from the other.
The file might look something like this
smith 1234.12345.12345 workerB
johnson 1223.12121.12122 workerC
There would be approx. 5000 entries like this.
Hopefully this is enough information, and again I am looking for the best data structure to use with Java(I think in C a tree structure was used in this case). But any hints would be welcome.
Thanks,
Bill
 
Cameron Park
Ranch Hand
Posts: 371
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think reading the data is pretty much the same, one line at a time. Retrieving is another matter. I also think tree is excellent, almost 1/2 the time to search and retrieve compared to linked list.
 
Bill Norton
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.
Does Java have built in classes for trees?
If not is there a class simliar to trees?
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic