So, how can we measure algorithm performance? There are two main ways:•Measuring the implementation of an algorithm, running the code on various inputs, and measuring the time and the memory it takes. This is called profiling.•<…>using a simplified model for the machine it would run on and abstracting many details. In this case, we focus on coming up with a mathematical law describing the running time and the memory in terms of the input size. This is called asymptotic analysis.