Array, maps . . . which is faster?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Array, maps . . . which is faster?

Richard Taubo
Hei!

If my requirements are to insert, sort and retrieve one type of value,
e.g: '1_0', '1_5', '1_4' . . .
which method is then the fastest for a large set of values if:
a) I need to find a specific value within the "list".
b) I can retrieve the value on top or bottom as long as the "list" is
sorted.

Is it:
- Arrays
- Maps
- Pairs
- Stacks
- Priority queues
or any other?

Thanks for input! :-)

Best regards,
Richard Taubo


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Array, maps . . . which is faster?

James Harvard
Maps cannot be sorted. Stacks, queues etc are just custom types that extend the array type, AFAIK.

So, as long as you can find values as you want with arrays (do you mean just check whether your data set contains the given value?) then I would think that arrays would be fastest. There's only one way to tell for sure though!

James Harvard

>If my requirements are to insert, sort and retrieve one type of value, e.g: '1_0', '1_5', '1_4' . . .
>which method is then the fastest for a large set of values if:
>a) I need to find a specific value within the "list".
>b) I can retrieve the value on top or bottom as long as the "list" is sorted.
>
>Is it:
>- Arrays
>- Maps
>- Pairs
>- Stacks
>- Priority queues
>or any other?

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage