2. A simple scheduling problem. We are given jobs j1, j2… jn, all with known running times t1, t2… tn, respectively. We have a single processor. What is the best way to schedule these jobs in order to minimize the average completion time. Assume that it is a nonpreemptive scheduling: once a job is started, it must run to completion. The following is an instance.
a)
#include <cstdlib>
#include <iostream>
using namespace std;
int N = 4;
int A[5]
= {0, 15, 8, 3, 10};
void MinHeapify(int i, int N)
{
}
void BuildMinHeap()
{
}
int HeapExtractMin(int &N)
{
}
int main(int argc, char *argv[])
{
}