• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating a tree nodes  RSS feed

 
Gurumurthy Ramamurthy
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,
I have the data like this:
00 11 22
00 11 23
00 12 32
00 12 33
00 13 44
01 11 55
01 12 66
I need to develop the hierarchy like this:
0 (root)

00 01
11 12 13 11 12
22 23 32 33 44 55 66

Can anyone suggest what data structure I should go for in Java?
Regards,
Guru
 
Dmitry Melnik
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you supposed to do with the data organized like this?
 
Gurumurthy Ramamurthy
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a kind of tree traversing and manipulations...
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do u mean ur program has to form a tree like this pattern?
*
**
***
****
Applying ur data in ascending order,
00
00 00
00 00 01
01 11 11 11
12 12 12 13 22
23 32 33 44 55 66
Is that the output u want? If we understand the specification of ur program clearly, we can help u more...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!