you are viewing a single comment's thread
view the rest of the comments
[–] 4 points 5 months ago (4 children)
  • [–] 3 points 5 months ago* (3 children)

    The bigger the pile, the longer it takes to find an individual item (worst case). How is that O(1)?

  • source
  • parent
  • hideshow 3 child comments
  • [–] 6 points 5 months ago* (2 children)

    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

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 5 months 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)"

  • source
  • parent
  • [–] 2 points 5 months ago* (last edited 5 months 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

  • source
  • parent