1.1 Problem Statements
An algorithm begins with a precise statement of the problem. The goal is to define the task so clearly that both correctness and complexity follow from the definition. Ambiguity at this stage propagates into proofs, implementations, and tests. A problem statement consists of four parts: input, output, constraints, and guarantees. Input specifies the structure and domain of data. You describe types, sizes, ordering, and any preconditions. For example, an input...