How to compare tricks (algorithms)

Tricks differ in a few ways.

  1. Relevance to the problem at hand. For instance, you wouldn't use a sorting trick to compute the Least Common Denominator.

  2. Speed to implement. Sometimes you can write a solution in one line of code, but it might not work for large groups of numbers.

  3. Speed of execution. Some tricks might take longer to write but can execute faster.

  4. Memory requirements. Some tricks can be very easy to implement and quick to write, but only if you have the memory resources to handle them.



Posted 01/24/2010