Algorithms & Data Structures

There are several steps to choosing an algorithm

  1. First, assess potential algorithms and data structures.

Consider how much data the program is likely to process.

  • If the problem involves modest amounts of data, choose simple techniques.

  • If the data could grow, eliminate designs that will not scale up to large inputs.

  1. Then, use a library or language feature if you can.

  2. Failing that, write or borrow a short, simple, easy to understand implementation.

  3. Try it.

  4. If measurements prove it to be too slow, only then should you upgrade to a more advanced technique.