Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 646 Bytes

w2_5.1_finding_the_minimum.md

File metadata and controls

22 lines (15 loc) · 646 Bytes

FINDING THE MINIMUM (20 points possible)

Consider a non empty array of integers a.

  1. Write a function min : int array -> int that returns the minimal element of a.

  2. Write a function min_index : int array -> int that returns the index of the minimal element of a.

Do you think these functions work well on large arrays ?

  1. Define a variable it_scales and set it to "yes" or "no".

YOUR OCAML ENVIRONMENT

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." ;;