Consider a non empty array of integers a
.
-
Write a function
min : int array -> int
that returns the minimal element ofa
. -
Write a function
min_index : int array -> int
that returns the index of the minimal element ofa
.
Do you think these functions work well on large arrays ?
- Define a variable
it_scales
and set it to"yes"
or"no"
.
let min a =
"Replace this string with your implementation." ;;
let min_index a =
"Replace this string with your implementation." ;;
let it_scales =
"Replace this string with your answer." ;;