How can be a largest number ina alist of 20 numbers be found?
Answers
Answered by
0
Step-by-step explanation:
A linear search will use O(20) steps, that is, constant time:
On input x1,…,x20
Let max=x1
For i=2 to 20
If xi>max then let max=xi
I hope this is efficient enough for you.
Similar questions