• Post Reply Bookmark Topic Watch Topic
  • New Topic

BST problem  RSS feed

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone..
the problem i'm having is that if i have nodes with the same keyword (in my case Surname), the search will only return the first one it finds... i understand what's happening but is there a way to make it go through the whole tree just in case there are other matches.......?

Thanks

 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marco Galea wrote:i understand what's happening but is there a way to make it go through the whole tree just in case there are other matches.......?

Yes, but you might want to ask yourself whether that's in fact what you want. Another possibility is to allow your key to be associated with more than one object, perhaps something like:and then you wouldn't have to worry about searching multiple keys, which keeps your current code correct (I assume ).

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!