3 ms·
This would be O(n), since the time it takes to pair your socks is still proportional to the number of socks you have
by theseoafs 12y ago
This would be O(n), since the time it takes to pair your socks is still proportional to the number of socks you have
- yen223 12y agoThe idea is that I don't need to pair my socks. I can just take any random 2 socks from the heap whenever I'm going out, since they are all the same. Hence, O(1).