Skip to content

Instantly share code, notes, and snippets.

@gsg
Created November 12, 2015 16:30
Show Gist options
  • Save gsg/86daca39d16bdc8492aa to your computer and use it in GitHub Desktop.
Save gsg/86daca39d16bdc8492aa to your computer and use it in GitHub Desktop.
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