order independent hash?

88888 Dihedral dihedral88888 at googlemail.com
Thu Dec 1 23:29:40 EST 2011


On Friday, December 2, 2011 12:18:29 AM UTC+8, Chris Angelico wrote:
> On Fri, Dec 2, 2011 at 2:52 AM, Dave Angel <d... at davea.name> wrote:
> > On 12/01/2011 10:35 AM, 88888 Dihedral wrote:
> >> I knew a hash can replace a bi-directional linked list.
> >> The value  can be a multi-field string  to be parsed for further actions.
> >> Is this what you are asking?
> >
> > A hash is a number, so I don't see how it can replace any kind of linked
> > list.  Perhaps you're thinking of some other language.
> 
> A hashtable is a form of data structure that involves hashing values
> (ie calculating hashes for them) and storing them for easier retrieval
> than a simple linked list offers. That may be what you're thinking of.
> 
> ChrisA

I clear my point a hash is a collection of (key, value) pairs that have
well defined methods and behavior to be used in programming. 

The basic operations of a hash normally includes the following:

1. insertion of a (key, value) pair  into the hash
2. deletion of a (key, value) from the hash
3. inquiring  a hash by a key to retrieve the value if the (key, value) 
pair available in the hash. If no key matched, the hash will return 
a not found result. 

The hash can grow with (k,v) pairs accumulated in the run time.
An auto memory management mechanism is required for a hash of a non-fixed size of (k,v) pairs. 

Some implementations of a hash might pose some restrictions of k and v
for some reasons. But in object programming k and v can be objects
to be manipulated by the programmer.  



More information about the Python-list mailing list