Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Are ordered hashes useful?
- Date: Wed, 16 Feb 2011 01:47:35 +0900
- From: Marty Pauley <marty.pauley@example.com>
- Subject: Re: [tlug] Are ordered hashes useful?
- References: <4D4E75AB.5060703@example.com> <4D4FB368.4010403@example.com> <AANLkTimk8AUJMRiwbPjGfDfciCwfaQr9_o3vBXtW2+rW@example.com> <87lj1rza76.fsf@example.com> <AANLkTikqy8G6G1Pt3ramSqxKHKJHSpo=zjHYLVENW0Gb@example.com> <878vxqyfok.fsf@example.com> <AANLkTiknPv3VsKzKQVxMacFE9i9aSSmwXDU4Fz+rZU3g@example.com> <AANLkTi=-0DXwOzc4yOriXptsvXkNZGh71Jgm=Rzu_2tW@example.com> <87y65iqchr.fsf@example.com> <4D59EC1B.9040403@example.com>
On Tue, Feb 15, 2011 at 11:59 AM, Raymond Wan <rwan.kyoto@example.com> wrote: > > Yes, I don't agree that dictionary order and ordered list > are the same. Ordered list access could be provided by a > tree, but to enable dictionary access, you either need to > augment the tree with a hash table or build two trees in > parallel. Don't say that too loudly. All the databases in the world may stop working!!! Maybe by "ordered list" you mean the insertion order, which is where this thread started. I'm talking about sorted key order, or "dictionary order" as you mentioned. But my main point is that trees do provide dictionary access. That's what they're for. In pseudocode: t = new Tree t.insert("banana" => "yellow") t.insert("carrot" => "orange") t.insert("apple" => "red") t.insert("durian" => "smelly") t.keys == {"apple","banana","carrot","durian"} # ordered access t.get("carrot") == "orange" # fast lookup Most large dictionaries use trees, not hashes. The whole point of a tree is that it provides fast lookup O(log n) and ordered access. Hashes don't cope well with a large amount of data (unless it's known in advance). -- Marty
- Follow-Ups:
- Re: [tlug] Are ordered hashes useful?
- From: Raymond Wan
- Re: [tlug] Are ordered hashes useful?
- From: Josh Glover
- References:
- [tlug] [Javascript] Shouldn't there be a sort option on objects
- From: Dave M G
- Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- From: Raymond Wan
- Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- From: Josh Glover
- Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- From: Stephen J. Turnbull
- Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- From: Josh Glover
- [tlug] Are ordered hashes useful?
- From: Stephen J. Turnbull
- Re: [tlug] Are ordered hashes useful?
- From: Jun-Dai Bates-Kobashigawa
- Re: [tlug] Are ordered hashes useful?
- From: Marty Pauley
- Re: [tlug] Are ordered hashes useful?
- From: Stephen J. Turnbull
- Re: [tlug] Are ordered hashes useful?
- From: Raymond Wan
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] [Lingo] Two direction full text search
- Next by Date: Re: [tlug] [Lingo] Two direction full text search
- Previous by thread: Re: [tlug] Are ordered hashes useful?
- Next by thread: Re: [tlug] Are ordered hashes useful?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links