Summary
In this chapter, we learned about computer algorithms, and their complexities (time and space). We also discussed how these complexities vary based on the size of the input. We investigated the different types of time complexities, including constant, linear, quadratic, cubic, and exponential, along with their Big-O notations. We then looked into the complexities of fundamental control structures and discussed these with regard to three fundamental flow types – sequential, selection, and repetitive flow. The complexities of linear and binary search algorithms were discussed in addition to the best-, worst-, and average-case scenarios. Toward the end, we learned about some other kinds of time complexity types, such as P and NP.
With the knowledge acquired in this chapter, you will be well equipped to choose the right kind of algorithm to solve a certain problem. In the next chapter, we will be looking into terminology and notation for trees, graphs, and networks...