[m-dev.] efficiency of mercury lists ?

Holger Krug hkrug at rationalizer.com
Sun Jul 29 02:14:27 AEST 2001


I need a list-like data-type which is optimized for the following three
operations:

a) concatenation
b) forward scanning from the start of the list
c) backwards scanning from the list tail

Can anybody tell me which library data-type fits best into this situation ?

`list' seems to require O(n) for a) and c).
`array' seems inefficient if a) is needed quite often.

Are their other possibilities ?

-- 
Holger Krug
hkrug at rationalizer.com
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list