The problem of scheduling n jobs of known durations t1,t2,...tn for execution on a single processor. The jobs can be executed in any order, one job at a time. we want to find a schedule that minimizes the total time spend by all the jobs in this system. The time spent by one job is the sum of the time spent on waiting plus the time spent on its execution. Design a greedy algorithm for this problem.
....so far i am thinking i have to get the shortest jobs first and to get that i would have to sort the array , but is it a single array ?