3 ms·
It isn’t really linear. Sleeping is a heap insertion which takes O(log n).
by jnwatson 3y ago
It isn’t really linear. Sleeping is a heap insertion which takes O(log n).
- bmacho 3y agoYou still have to read all the inputs at least, which is at least linear time, in the size of the input.
- QuadmasterXLII 3y agoEach sleep is log n for the heap insertion, so the overall complexity is at least n log n