• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to search number from tuple tree?  RSS feed

 
azar azlan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone know the code for search number from tuple tree? I want to add into my code below. My idea below is to search number from the tree and then print the number. For example, enter input for event is 4, input for strength is 3. Then generate tuple tree. Then user enter number for searching. That number will check every branches in the tuple tree. Then it will printout the number.

Main class code.



Tree utils code.

 
Stan Lederer
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you explain what a tuple tree is and, in English, what your algorithm is for searching it? Then, maybe someone will be able to help.

Also, there are way too many hardcoded print statements. I'm sure that whatever the algorithm is there will be a more elegant way to code it than all of those print statements?

Is this for a class assignment? I'm trying to get a sense of how much you are expected to know about java structures to code this.
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!