• adj16@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    1
    ·
    11 months ago

    I’m not sure Big O notation applies when your n is literally infinite universes…

    And actually, on an even more pedantic note (if possible), if you are iterating through each array until you find an item out of order, and repeat this on every array, I’m fairly certain it’s more than O(n). Less than O(n^2) too, so it’s probably O(n*log(n))…but I’m a little out of my depth here

    • morrowind@lemmy.ml
      link
      fedilink
      English
      arrow-up
      8
      ·
      11 months ago

      You’ve gotten it a bit mixed up. The n is the array size, not the number of universes. It takes O(n) to check if the array is sorted, and this happens once in every universe.

      You seem to be envisioning some sord of 5D cross-universe program.

    • vrighter@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      2
      ·
      11 months ago

      universes execute in parallel. each of the N elements in the array is checked in all universes simultaneously. so only O(n)