4 ms·
When people say list, I think linked-list. When they say array, I think contiguous array. I wish we could standardize on that terminology, it makes sense and al
by DanWaterworth 15y ago
When people say list, I think linked-list. When they say array, I think contiguous array. I wish we could standardize on that terminology, it makes sense and allows easy differentiation between the 2 concepts.
- JulianMorrison 15y agoClojure implements them in trees of contiguous arrays :-P http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/ http://blog.higher-order.net/2009/02/01/understanding-clojur...
- radarsat1 15y agoI used to do that, but now I try to think in terms of the abstraction "list" and "array", and not worry about the underlying data structure unless I'm specifically thinking about efficiency. For example there are multiple ways of implementing lists and arrays that have similar interfaces but different efficiencies for insertion/sort/search, etc. So basically the dichotomy you propose is just "too simple," it doesn't cover all the options and combinations that a programmer may need to think about.
- DanWaterworth 15y agoI didn't say that it was a dichotomy, actually I tend to think of the space as roughly split into three: lists, arrays and annotated/sorted trees. Lists and arrays are really common though, so I think it makes sense to make it easy to refer to them using short words.
- kibwen 15y agoFunny, I had the exact same thought but with regard to Dart's maps (a.k.a. associative arrays, hash[maps], [hash] tables, dictionaries, records, objects (Javascript), or even just arrays (Tcl)).