Consider the pseudocode below:
| Mystery1(Array[a1, a2, ... , aN]):
B := []
FOR elem IN Array LOOP
IF first THEN
B[0] := elem
ELSEIF elem > LAST(B)
APPEND(B, elem)
END IF
END LOOP
RETURN B
|
What would the Mystery1 algorithm return when its input is [3, 2, 5, 5, 8, 17, 16]