🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #2264

Novice HashTable Question

#2264
From: Ken Smith
Date: Sat, 09 Jan 1993 22:27
23 lines
1435 bytes
I want to use the HashTable class to implement a symbol table for a
simple expression evaluator that I'm writing, however there seems to
be one crucial feature missing from HashTable (or more likely I just
can't figure it out).

My question:  Given a "value", how does one determine its associated
              "key" in a HashTable?

When using hash tables that I've written in the past, I've found it
useful (actually essential) to be able to quickly lookup a table entry
given *either* its key or its value.

In other words, how come there isn't a "keyForValue" method in addition
to the existing "valueForKey" method?

Thanks in advance,
Ken Smith
--
_______________________________________________________________________
                                                       kenny@netcom.com
-- 
_______________________________________________________________________
                                                       kenny@netcom.com
Technical Details
Message-ID: <KENNY.93Jan9142756@netcom2.Netcom.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!csus.edu!netcom.com!netcom!kenny

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!csus.edu!netcom.com!netcom!kenny
From: kenny@netcom2.Netcom.COM (Ken Smith)
Subject: Novice HashTable Question
Message-ID: <KENNY.93Jan9142756@netcom2.Netcom.COM>
Sender: kenny@netcom.com (Ken Smith)
Organization: Netcom Online Communications Service
Distribution: comp
Date: Sat, 9 Jan 1993 22:27:56 GMT
Lines: 23