Re: Indexed vs associative data structures?
- Posted by krg May 19, 2014
- 1403 views
Sorry for not elaborating on the differences - I thought my post was long enough!
Jim has said it all, but I'll just add the following.
Indexed data structures are very fast to access and manipulate (especially when doing slices), and use very little memory. Euphoria's sequences are so elegant that I keep wanting to port them to other languages!
Lua, awk and Rexx use associative arrays as their only data structure. It works great, except that you sacrifice speed and memory when all you need is a simple contiguous array of values.
Maps (associative arrays) in Euphoria 4.x are handy, especially when doing things like HTTP header processing.
HTH