Talk:VList: Difference between revisions

m
Line 24:
:::(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 -- and subtract the index you are using from the length of the array to achieve the "add to front" semantics of the VList). 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