UNIT I
UNIT: Algorithms & Complexity Analysis 1. Algorithm Definition An algorithm is a finite sequence of well-defined, unambiguous steps designed to solve a specific problem or perform a computation. 👉 In simple words: An algorithm is a step-by-step procedure to convert input into output. Example (Finding Maximum of Two Numbers) Start Read two numbers a and b If a > b , print a Else print b Stop 2. Characteristics of an Algorithm A good algorithm must satisfy the following properties: Input An algorithm can have zero or more inputs . Inputs are externally supplied. Output Produces at least one output . Output is the solution to the problem. Definiteness Each step must be clear and unambiguous . No confusion in instructions. Finiteness The algorithm must terminate after a finite number of steps . Effectiveness Each operation must be simple and executable in finite time. Correctness Produces the c...