Re: [Vala] sorted keys from a hash



On Sat, Feb 13, 2010 at 02:54:21 +0530, Martin DeMello wrote:
What's the most efficient (in terms of speed) way to iterate over a
hash in sorted order of the keys? The keys are strings.

To use a balanced tree.

Hash can only ever be iterated in the hash order, which is fixed but
pseudo-random.

-- 
                                                 Jan 'Bulb' Hudec <bulb ucw cz>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]