2 ms·
Actually you don't even need a priority queue. Two lists, you read from one push to the second. When you are done you swap them
by furstenheim 5y ago
Actually you don't even need a priority queue. Two lists, you read from one push to the second. When you are done you swap them