• Azzu@leminal.space
    link
    fedilink
    English
    arrow-up
    15
    ·
    5 days ago

    Well you’re supposed to keep the structure an array, not let it become a stack.

    • Sophienomenal@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      6
      ·
      5 days ago

      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.