• Lysergid@lemmy.ml
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      edit-2
      3 days ago

      I mean, if structure is O(1) for low N, it’s still O(1) for high N. If O “changes” from 1 to N with size then it’s never been 1. All I’m saying

      “if it’s big”

      is not how you identify correct O

      • hirihit640@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        3
        ·
        3 days ago

        I only put “if it’s big” to help readers imagine a large pile and how it would become more inconvenient the larger the pile. Language is not as precise as math or programming. If you’d like you can imagine the sentence as saying something like “imagine a big pile. It’s definitely not O(1)”

      • Lojcs@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        2 days ago

        It is quite reasonable to limit the average case O to the most common inputs with the caveat that it can be worse otherwise. It’s not like every arithmetic operation is counted as O(n) in Python for example as you aren’t expected to use numbers larger than 2^32 often