Work Breakdown Structure (WBS) in Software Engineering - Time & Space Complexity
When creating a Work Breakdown Structure (WBS), it is important to understand how the effort to complete tasks grows as the project size increases.
We want to know how the number of tasks and subtasks affects the overall work needed.
Analyze the time complexity of breaking down a project into tasks and subtasks.
function createWBS(task, depth) {
if (depth === 0) return;
for (let i = 0; i < 3; i++) {
createWBS(task + '.' + i, depth - 1);
}
}
createWBS('Project', 3);
This code breaks a project into 3 subtasks at each level, repeating this for a given depth.
- Primary operation: Recursive calls creating 3 subtasks at each level.
- How many times: The function calls itself 3 times per level, repeated for each depth level.
Each level multiplies the number of tasks by 3, so the total tasks grow quickly as depth increases.
| Depth (n) | Approx. Number of Tasks |
|---|---|
| 1 | 3 |
| 3 | 27 |
| 5 | 243 |
Pattern observation: The number of tasks grows exponentially with depth, tripling at each level.
Time Complexity: O(3^n)
This means the work grows very fast as the number of levels increases, tripling for each added level.
[X] Wrong: "The number of tasks grows linearly with the number of levels."
[OK] Correct: Each level multiplies tasks by 3, so the total grows much faster than just adding tasks one by one.
Understanding how task breakdown grows helps you plan projects better and shows you can think about scaling work efficiently.
"What if each task only created 2 subtasks instead of 3? How would the time complexity change?"