Week 3 in Learn to Program: Crafting Quality Code covered Analyzing Algorithms and different sorting methods. In analyzing algorithms we determine how much time and other resources are spent on their execution.
To analyze an algorithm the focus was placed on how many times the print function gets called and then visualizing the run time. If a function has a runtime that grows linearly in respect to the size of the input it’s referred to as a linear function.
A quadratic function is a function, whose runtime grows in quadratic fashion compared to the size of the input.
Finally, logarithmic functions use a mathematical operation to determine the runtime:
This operation determines how many number of times we have to divide a number(n) by 2 to reach 1.
View original post 40 more words