Task Scheduler (LeetCode)

Veröffentlicht am: 16 Mai 2024
auf dem Kanal: Daiki Algo Coach
27
0

https://leetcode.com/problems/task-sc...

Retrospection 1

I used a min heap for `coolings` in my solution.
However, I can use a queue instead because the first task which went into cooling intervals becomes executable first.

In this approach, assuming that L = len(tasks) and N = number of type tasks, the time complexity is O(L * logN).

Retrospection 2

Since number of type tasks is up to 26, I can think of it as a constant in the complexity analysis.


Ref

   • Task Scheduler - Leetcode 621 - Python  

#leetcode #heap


Auf dieser Seite können Sie das Online-Video Task Scheduler (LeetCode) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Daiki Algo Coach 16 Mai 2024 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 27 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!