Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Saving tree structure

 
Stewart Griffin
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey ppl,
I'm trying to store the structure of a tree.
Any ideas on the best way of achieving this?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not simply serialize the entire tree to a file? (starting from the root node)
kind regards
 
Ellen Zhao
Ranch Hand
Posts: 581
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Steward,
I would choose LinkedList or Vector to implement a tree data structure, generally speaking, both of them work fairly well for binary tree/binary search tree/AVL tree/fibonacci tree/b tree/b* tree(use double LinkedList here)/suffix tree/game tree etc. I don�t quite understand the "store" you mentioned here. Because usually when the tree is being generated, both its innern notes and leaves are stored in the LinkedListed or Vector. Could you please offer some further specification? I guess you wanted to visit all the notes in the tree ?

Regards,
Ellen
[ January 31, 2003: Message edited by: Ellen Fu ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic