Answer
procedure extremes $( a_1, a_2, a_3, ... a_n:$ finite sequence of integers$)$
smallest $:=$ $a_1$
largest $:= a_1$
for $i:=1$ to $n$
$\space\space\space$ if $a_i$ largest then largest$:= a_i$
return $\{ $ smallest, largest $\}$
Work Step by Step
The algorithm attempts to find the smallest and largest values in a sequence of integers. We initialize two parameters to store the smallest and largest values for every value we encounter as we loop through the array. We return both values as a set of values.
Note that an alternate solution could sort the sequence and then return the smallest and largest values immediately (the first and last values respectively). This would be overkill and would be computationally costly (a lot more steps required to get the result.)