Task Scheduler (LeetCode)

Pubblicato il: 16 maggio 2024
sul canale di: 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


In questa pagina del sito puoi guardare il video online Task Scheduler (LeetCode) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Daiki Algo Coach 16 maggio 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 27 volte e gli è piaciuto 0 spettatori. Buona visione!