0
0
Software Engineeringknowledge~5 mins

Waterfall model in Software Engineering - Time & Space Complexity

Choose your learning style9 modes available
Time Complexity: Waterfall model
O(n)
Understanding Time Complexity

We want to understand how the time needed to complete a project changes as the project size grows when using the Waterfall model.

Specifically, how does the process time increase as the number of project steps or tasks increases?

Scenario Under Consideration

Analyze the time complexity of the Waterfall model process steps.


// Waterfall model phases
// 1. Requirements gathering
// 2. System design
// 3. Implementation
// 4. Testing
// 5. Deployment
// 6. Maintenance

// Each phase is done one after another, no overlap
// Each phase depends on the previous one finishing
    

This shows the Waterfall model as a sequence of phases done one by one, each depending on the last.

Identify Repeating Operations

Look for repeated work or loops in the process.

  • Primary operation: Completing each phase once in order.
  • How many times: Each phase runs exactly once, no loops or repeats.
How Execution Grows With Input

As the project size grows, the time to complete each phase grows roughly in proportion to the work needed in that phase.

Project Size (n)Approx. Time
10 tasksTime for 10 tasks done in sequence
100 tasksAbout 10 times longer than 10 tasks
1000 tasksAbout 100 times longer than 10 tasks

Pattern observation: Time grows roughly in a straight line with project size because phases are done one after another without overlap.

Final Time Complexity

Time Complexity: O(n)

This means the total time grows directly in proportion to the size of the project or number of tasks.

Common Mistake

[X] Wrong: "The Waterfall model allows phases to run at the same time, so time doesn't grow much with project size."

[OK] Correct: In Waterfall, phases happen one after another, so total time adds up and grows with project size.

Interview Connect

Understanding how time grows in Waterfall helps you explain project planning and scheduling clearly, a useful skill in many software roles.

Self-Check

"What if we allowed some phases to overlap or run in parallel? How would the time complexity change?"