Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Containers [POLL][PERCEPTION]

Name: Anonymous 2011-09-26 1:44

You stumble upon a new programming language.

1) The programming language has a main built-in data type called list, used as such: l = [1,2,3];. What would you normally expect of the underlying implementation -- would you expect it to be a linked-list (random access O(N)), an array (resize O(N)), or perhaps an unrolled link list (random access and resize amortized O(log(N)))?

2) You discover that the programming language also has a built-in data type called array. How does this affect your assumptions relative to list, and what will your new expectancies relative to array be?

Name: Anonymous 2011-09-27 9:32

>>26
I can't see how you can possibly think that linked lists are a better idea than unrolled linked lists
Me neither. But I've yet to see any benchmark proving unrolled linked lists superiority. Also, there's a spirit in the CPU which knows about linked lists.

non-generic hash tables
You mean the ones where you can't supply your own comparator function so it uses the reference casted to an integer as a key? Yeah, no, no thanks.
No, I mean that the language has optimized hash tables for its primitive types, but doesn't provide a generic hash table implementation.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List