What is an algorithms? From chapter 1 of Introduction to Algorithms, an algorithm is any well-defined procedure that transforms a set of input to a set of output with desired properties. It is a tool for solving a computational problem, which specifies the desired input/output relationship. Input → Algorithms → Output The…