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

You want to think your pile is O(1) for retrieval, but it's actually O(n).

Meanwhile, the closet actually is O(1) for retrieval, but you don't want to spend the time for the bulk insert it requires beforehand.

  • source
  • hideshow 5 child comments
  • [–] 11 points 11 months ago*
    • O(n) worst case
    • O(log(n)) average case
    • O(1) best case
    • O(2) median case

    That last one: it's a LIFO stack. You might not immediately wear what you threw on last night, but probably would wear the thong under that

  • source
  • parent