Find the maximum of a sequence of n integers, using the following algorithm. Algorithm 1 procedure max(a1, a2, . . . , an : integers) max := a1 for i := 2 to n if max < ai then max := ai return max{max is the largest element}

Solved
Show answers

Ask an AI advisor a question