On Tue, Mar 12, 2002 at 09:45:59AM +0100, Lars Gullik Bjønnes wrote:
> In the lyxtextclass senario there is little a conststring class could
> do... comparisons are O(n) on the string anyway.

Worst case of course.
 
> One further optimization, over that patch that I sent, is to use a
> hash_map if it exists. That would give O(1) lookup.

I'd still say its overkill unless you show gprof figures...

> There is also the possiblity of using a "tuning" lists, and list where
> often used items are moved forward, so that lookup is faster next time
> the same iterm is wanted, but is still O(n) in the general case.

If we re-order the list we could simply sort it and use binary search,
couldn't we?

Andre'

-- 
André Pönitz .............................................. [EMAIL PROTECTED]

Reply via email to