4 ms·
Keeping things in a single pile makes insertion O(1) but makes retrieval a linear O(n). Depending on your usage pattern this may or may not make sense. Person
by Splines 10y ago
Keeping things in a single pile makes insertion O(1) but makes retrieval a linear O(n). Depending on your usage pattern this may or may not make sense.
Personally I sort my mail by category (junk mail, mail my wife might be interested in, mail I am interested in). This means there is a one time linear traversal of my mail by me but this allows constant time retrieval of a list of mail by my wife, which she appreciates.
- tamana 10y agoNot O(n) because your eyesight is highly parallel pattern recognition, and you can move items in batch.
- Splines 10y agoThe bottleneck isn't the optical system, it's the mechanical swing arms that's the gating factor.
- omgtehlion 10y agoOk, my wife organizes my daily t-shirts as a deque: fresh comes into bottom, I take always from the top ) O(1) insertion O(1) retrieval.
- hobarrera 10y agoO(n) is stupidly efficient when it comes to looking across all my pants (5) or my shirts (8? 9?). Any complex effort to even bring that down to O(log n) would probably take decades to pay off.