sorts tasks from earliest deadline to latest