It looks like you're new here. If you want to get involved, click one of these buttons!
since KL does not have double-linked lists (which I could implement myself, but I'd like to stay "canon"): What is the fastest (text speak: instant) way of extending an array "to the left"?
What I mean is this: When resizing an array to a larger size, new entries are created at the end of the array. But what if I need new entries at the beginning, so that all entries that were (1, 2, ..., n) now become (x+1, x+2, ... x+n)? I do not want to actually copy the values over, since that would become insane with a particle setup of a couple of million entries.
I could, of course, use a "0-index" in my global variable set, so that "resize to left" would actively become "standard resize, but increase 0-index". That would give me "add entries to the virtual left", but makes the code more complex, as I'd have to carry along the "0-index" or "offset" marker.
If there isn't a fast (read: instant) way of doing it, I may revert to double-linked lists, but I could imagine that this (performance) question is slightly more than a goof-ball-geek-thing ...
Marc Albrecht - marc-albrecht.de - does things.
©Copyright 2017 Fabric Software Inc. All rights reserved. | Privacy