function mdd(processed, task) return max(processed + task.processTime,
function mddSort(tasks) unsortedTasks = copy(tasks) sortedTasks = list processed = 0 while unsortedTasks isn't empty bestTask = unsortedTasks.getFirst()