4 ms·
Your work sounds awesome. (And you probably mean O(n) and not O(1), otherwise O(log(n)) isn't really an improvement).
by dirkt 5y ago
Your work sounds awesome.
(And you probably mean O(n) and not O(1), otherwise O(log(n)) isn't really an improvement).
- chunkyks 5y agoNo, that's the point; the previous algorithm was O(1) [a simple queue] but that led to doing a huge amount of extra work. By using a smarter queue that "cost" an extra O(log(n)), we could skip work that didn't need doing in the first place.