Created
November 12, 2015 16:30
-
-
Save gsg/86daca39d16bdc8492aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let min a = | |
let index = 0 in | |
let elt = a.(0) in | |
let rec loop index elt = | |
if index >= Array.length a then elt | |
else if a.(index) < elt then | |
let elt = a.(index) in | |
... in | |
if Array.length a = 1 then a.(0) | |
else loop index elt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment