Answer:
procedure last smallest a1,a2,....,an: integers)
min = a1 and location = 1
for i = 2 to n
if min > ai then
min ai and location = i
return location
Explanation:
The first step is to define the function or procedure last_smallest; This is done by this line
procedure last smallest a1,a2,....,an: integers)
The next step is to initialize two variables to 1; The first variable is the min which represents minimum while the second is location, which represents its location
min = a1 and location = 1
The next is to iterate from the second element to the last
for i = 2 to n
This line checks for the smallest element; if the following conditional statement returns true, then:->
if min > ai then
->It assigns appropriate values to min and location
min ai and location = i
The last step returns the assigned location of the element
return location