cross-posted from: https://feddit.fr/c/lemmyshitpost/p/406365/i-also-have-one
cross-posted from: https://feddit.fr/c/microblogmemes/p/226650/i-also-have-one
cross-posted from: https://feddit.fr/c/lemmyshitpost/p/406365/i-also-have-one
cross-posted from: https://feddit.fr/c/microblogmemes/p/226650/i-also-have-one
Well you’re supposed to keep the structure an array, not let it become a stack.
Unfortunately, though the reserved memory is sequential, the order in which items are added is pseudorandom, and gravity prevents random access, so you would still need a linear search of O(n) time to find any given item.