• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Could you criticize my implementation of the Tree?

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you criticize my implementation of the Tree?
Code locates here - http://jroller.com/page/vbez
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It was hard for me to understand just what you were trying to do with the code. Maybe it would be useful to just spell that out.

One thing I noticed is that your delete node method does not recursively remove children and grand-children of the node to be removed, first, so they get orphaned when their ancestr gets whacked. Depending on the function of the tree, this may not be a big deal, but I thought I would mention it.

Also, I'm not sure that it is all that useful to have the serialization/externalization use XML. Unless there's a specific reason why not, you might as well serialize the entire tree and write it as an ObjectStream. It should do the job just as well, unless you need to be able to modify the data in the serialized state.

HTH,
jdmaddison
 
reply
    Bookmark Topic Watch Topic
  • New Topic