• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Search based on Keys other than HashMap

 
Prashanti Potukuchi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I had a HashMap with some key and value pairs. Now the value part is no more valid. Can anybody suggest an alternative data structure so that i can still search based on the key, (instead of iterating through the entire thing like arrays) and do not have any associated value part.
Thanks
Prashanti
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, you just want to know if the key exists or not? No value to retrieve? Sounds like a HashSet.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, two more things:
1) Welcome to JavaRanch!
2) Please take another look at our display name policy and edit your display name to include a first and last name. Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic