Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

help with testing a hashtable  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone please help, as i have been stuck on this problem for ages.
I have this code below, that test to see what other values are equal st1, and once it has found them, get there key values and put them into arraylist, and remove the values that i have already tested.
But my problem is how the heck can i now test the next value that is in the hash table. for example
test 1: test st1 get the keys that match st1 put them into a arraylist and then remove the values from the hashtable.(i can do the first test).
this is my problem the next tests.
loop though somehow.
test 2: test st2 if it has already been used test st3, if st2 has not been use get the keys that are equal to st2 and put them into the arraylist and remove the values from the hashtable.
and keep testing each value in the hashtable untill all of the values have been tested.
could someone please help me
thanks for your time
nicky
 
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are only saving the KEYS that have been used, you have no way of looking up what VALUES those keys related to that were also already used.
You need to save the value that was removed (st1) and the do something like
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!