(maxHeap, n, cpuIntervals = [0])
| 32 | }; |
| 33 | |
| 34 | const getMinimumCpuIntervals = (maxHeap, n, cpuIntervals = [0]) => { |
| 35 | while (!maxHeap.isEmpty()) { |
| 36 | const { iterations, coolingPeriodQueue } = execute( |
| 37 | n, |
| 38 | maxHeap, |
| 39 | cpuIntervals, |
| 40 | ); |
| 41 | |
| 42 | reQueueCoolingPeriod(coolingPeriodQueue, maxHeap); |
| 43 | |
| 44 | if (!maxHeap.isEmpty()) cpuIntervals[0] += iterations; |
| 45 | } |
| 46 | |
| 47 | return cpuIntervals[0]; |
| 48 | }; |
| 49 | |
| 50 | const execute = ( |
| 51 | n, |
no test coverage detected