home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / next / programm / 8047 < prev    next >
Encoding:
Text File  |  1993-01-09  |  1.4 KB  |  35 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!csus.edu!netcom.com!netcom!kenny
  3. From: kenny@netcom2.Netcom.COM (Ken Smith)
  4. Subject: Novice HashTable Question
  5. Message-ID: <KENNY.93Jan9142756@netcom2.Netcom.COM>
  6. Sender: kenny@netcom.com (Ken Smith)
  7. Organization: Netcom Online Communications Service
  8. Distribution: comp
  9. Date: Sat, 9 Jan 1993 22:27:56 GMT
  10. Lines: 23
  11.  
  12. I want to use the HashTable class to implement a symbol table for a
  13. simple expression evaluator that I'm writing, however there seems to
  14. be one crucial feature missing from HashTable (or more likely I just
  15. can't figure it out).
  16.  
  17. My question:  Given a "value", how does one determine its associated
  18.               "key" in a HashTable?
  19.  
  20. When using hash tables that I've written in the past, I've found it
  21. useful (actually essential) to be able to quickly lookup a table entry
  22. given *either* its key or its value.
  23.  
  24. In other words, how come there isn't a "keyForValue" method in addition
  25. to the existing "valueForKey" method?
  26.  
  27. Thanks in advance,
  28. Ken Smith
  29. --
  30. _______________________________________________________________________
  31.                                                        kenny@netcom.com
  32. -- 
  33. _______________________________________________________________________
  34.                                                        kenny@netcom.com
  35.