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

Tree Data Structure

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Can somebody help me with my Tree implementation. I have an array list with values("1.1","1.2","1.3","1.3.1.1","1.3.1.2","1.4","1.4.1.1","1.4.2.1","1.4.2.1.1.1","1.4.2.1.1.2","1.5","1.6","1.6.1.1") and I m trying to create a Tree with this data. Please find below attached my code for the same.

My tree should look like this in the picture attached.


Now I want to print the parent of each node starting from the last one, so starting at "1.6.1.1" . and but dont know to to traverse the branch 1.4.1.1 and it's children. Please someone help me.
PS: I am new to java so please correct me if tehre is something wrong.
Unbenannt_1.jpg
[Thumbnail for Unbenannt_1.jpg]
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Shine Tom wrote:Can somebody help me...


This thread appears to be a duplicate of this one.

Please don't double-post.

Locking...

Winston
 
    Bookmark Topic Watch Topic
  • New Topic