Computer Science I / Relations
Practice question · Multiple choice

Task dependencies form a partial order and topological sort produces a valid build order. Why does the algorithm need a partial order rather than a total one?

Hints
  1. Two independent modules: which should be built first?
  2. Ask what a total order would be asserting about every pair of tasks.
Show the answer

C. Because most tasks are genuinely incomparable

Why

Most pairs of tasks have no relationship, and a partial order says so, which is exactly the information a build system exploits to run them in parallel. A total order would invent constraints that do not exist. Option 4 has it backwards: a cycle means a circular dependency, which is the error a build tool reports.

Read the lesson: Relations →

Practise Relations

The app has 5 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Relations