From 7cd5b2b92c26fc961ff8e4e4dd1e72e9b2de222b Mon Sep 17 00:00:00 2001 From: Rushil Umaretiya Date: Thu, 18 Apr 2024 19:30:59 -0400 Subject: [PATCH] FINISHED --- task.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/task.c b/task.c index b6f9377..d1482bc 100644 --- a/task.c +++ b/task.c @@ -201,7 +201,8 @@ void heapify(int i) { float next_ratio = (float)next->priority / (float)next->remaining_cycles; - if (curr_ratio > next_ratio) { + if (curr_ratio > next_ratio || + (curr_ratio == next_ratio && curr->priority > next->priority)) { swap(curr->pid, next->pid); k = j; } else {