let rec get_smallest li curr_idx small_idx = let end_idx = (List.length li) - 1 in match curr_idx with end_idx -> small_idx | _ -> if li.[curr_idx] < li.[small_idx] then get_smallest li (curr_idx+1) curr_idx else get_smallest li (curr_idx+1) small_idx;;