Company: CARS24
Difficulty: medium
Task Scheduling Optimisation You are building a task scheduling system for a high-performance computing cluster. Each task has a priority and an estimated execution time. The goal is to efficiently schedule tasks based on their priority while maintaining a circular priority deque to minimize task switching overhead. Design a data structure and algorithm to manage the task scheduling efficiently. Implement a Circular Priority Dequeue to maintain tasks in the order of their priority. This should ensure that the highest priority task is always scheduled next. Tasks with the same priority should be executed in a first-come, first-served manner. Function description Your task is to implement the following operations: enqueue(task, priority, execution_time): Add a new task with the given priority and estimated execution time to the Circular Priority Dequeue. dequeue(): Remove and return the highest priority task from the Circular Priority Dequeue. execute_next_task(): Execute the next highes