Talk:VList: Difference between revisions

Line 20:
# The second operation, "new array begining at second element" blah blah, is too limited. It's equally easy to take any valid array slice.
# However, if a slice is taken, some clarification is needed as to what can be done with it. Should the content be copied? Should the content be copied only when it's modified, or only when the slice is extended? --[[User:Ledrug|Ledrug]] 01:53, 10 September 2011 (UTC)
 
:In my opinion, the "Obtain a new array beginning at the second element of an old array (O(1))" is a bogus requirement. Either:
::(a) The array is not a new array but a reference into the old array, or
::(b) The time to complete the operation is O(n) rather than O(1).
:And... without this issue, these performance characteristics can be achieved with regular arrays (or, for a language like C: a structure which consists of a pointer to an array, the currently used array length and the currently allocated array length -- when you need more space, use realloc to double the allocated space). This flat array approach results in a simpler algorithm and significantly lower constant factors when reading the data. --[[User:Rdm|Rdm]] 15:01, 13 September 2011 (UTC)
6,951

edits