Running Time

Divide and Conquer Algorithms

Divide and Conquer Algorithms

A very popular algorithmic paradigm, a typical Divide and Conquer algorithm solves a problem using following three steps:

  • Divide: Break the given problem into subproblems of same type.

  • Conquer: Recursively solve these subproblems

  • Combine: Appropriately combine the answers

The 5 Fundamental Running Times in Computer Science

The 5 Fundamental Running Times in Computer Science

As you see, you should make a habit of thinking about the time complexity of algorithms as you design them. Asymptotic analysis is a powerful tool, but use it wisely. Sometimes optimizing runtime may negatively impact readability or coding time. Whether you like it or not, an effective engineer knows how to strike the right balance between runtime, space, implementation time, maintainability, and readability.