liveBook · Manning

Task prioritization

As explained in Advanced Algorithms and Data Structures

A heap priority is a value assigned to an element that determines its ordering relative to other elements in a heap.

Task prioritization determines which task should be handled next when available work has different levels of urgency or importance. It replaces a fixed arrival order with a decision rule: assign each task a priority, then select the highest-priority task whenever capacity becomes available. section 2.2 section 2.4.2

A bug tracker makes the constraints concrete. Developers are limited, new bugs appear continuously, and existing priorities can change. Sorting once is therefore insufficient; the structure must support repeated insertion, selection, and reprioritization. A bug can be represented with a priority such as severity or the number of days until it must be solved. section 2.2.1

Bug severity determines the next task

Given bugs with severities from 1 to 10, a priority ordering can return “UI breaks on browser X” before “Page loads take 2+ seconds.” Adding an unencrypted-password bug with severity 10 changes the next selection without requiring the entire task list to remain statically sorted. section 2.2.1

A priority queue implements this behavior, commonly with a heap. The heap keeps the highest-priority element at the top while imposing only the ordering required by its heap invariant. A general implementation can accept a priority function; a specialized task heap can instead store tuples such as (priority, task) and use tuple ordering. Larger values define a max-heap, while smaller values define a min-heap. Reversing the priority convention or taking reciprocals converts one interpretation into the other. section 2.5.4 section 2.4.2

Task description

Severity (1-10)

Page loads take 2+ seconds

7

UI breaks on browser X

9

Optional form field blocked when using browser X on Friday the 13th

1

CSS style causes misalignment

8

CSS style causes 1px misalignment on browser X

5

Use the severity table to compare task descriptions with assigned priorities before examining the resulting priority order. section 2.2.1

How Advanced Algorithms and Data Structures covers it

How deep it goes
Defines priority functions and heap conventions, but stops short of detailed heap-operation implementation.
Examples
Uses emergency rooms, operating-system schedulers, to-do lists, email triage, and bug-severity tables as prioritization examples.
What you can do after
Apply it via a priority queue or heap to select changing tasks according to a configurable ordering.
How it connects
Connects task prioritization with priority queues, FIFO queues, heaps, min-heaps, max-heaps, binary search trees, and treaps.

Also explained in

Compare how 5 books explain task prioritization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Advanced Algorithms and Data Structures. The section links point to the parts of the book it draws on.