• murtaza64@programming.dev
    link
    fedilink
    arrow-up
    11
    ·
    10 months ago

    you can make it sort the first k elements and it will still be O(1). Set k high enough and it might even be useful

    • xmunk@sh.itjust.works
      link
      fedilink
      arrow-up
      5
      ·
      10 months ago

      I set k to 50,000,000,000… that’s more items than my shitty computer can fit in memory (including swsp) but I am now happy to celebrate my O(1) algorithm.

    • KubeRoot@discuss.tchncs.de
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      10 months ago

      By that logic, any sorting implementation is O(1), as the indexing variable/address type has limited size