Given a sequence of jobs with execution times \(T_1, \ldots, T_n\), we have to determine an execution order for the jobs, such that the average endtime is as small as possible. E.g. consider jobs with execution times (15, 8, 3, 10). Executed in that order, the average endtime is \((15+23+26+36)/4 = 25\). However, executing them in the order (3, 8, 10, 15) gives average endtime \((3+11+21+36)/4 = 17.75\).
Write a Python function minimumAverageEndtime
that takes a list of execution times for \(n\) jobs and returns the minimum average endtime.
>>> minimumAverageEndtime([15, 8, 3, 10])
17.75