Skip to main content

Introduction

For every algorithm, it is important to understand the following:

  1. What problem does this algorithm solve?
  2. When can this algorithm be applied? (That is, what are the preconditions? When does the algorithm fail?)
  3. Why does the algorithm give the correct answer?
  4. What is the key invariant behind this algorithm?
  5. What is the running time of the algorithm? Are there any optimisations possible?