1. ALGORITHMS An algorithm is any well definedcomputational procedure that takes somevalues, or set of values as input andproduce some value as output. An algorithm is thus…