• 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

how to search number from tuple tree?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Opportunity is missed by most people because it is dressed in overalls and looks like work - Edison. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic