Computers and Technology
Computers and Technology, 10.11.2019 00:31, nailah742

Write an oz function which has at its input a list of integers and returns the maximum element. for example, {max [3 ~2 0 4 5 1]} should return 5. the optimal algorithm for determining the maximum element of a list with n elements is doing n-1 comparisons. write an oz function which has at its input a list of integers and returns the first two maximum elements. for example, {max [3 ~2 0 4 5 1]} should return 5 and 4. what is the optimal number of comparisons needed? try to write an optimal version (for maximum mark).

answer
Answers: 1

Similar questions

Do you know the correct answer?
Write an oz function which has at its input a list of integers and returns the maximum element. for...

Questions in other subjects:

Konu
Social Studies, 19.08.2020 01:01
Konu
Social Studies, 19.08.2020 01:01