fun
insert_place (a,_) = a;fun
mode nil = 0| mode (h::t) = letfun
sorted (x,y) (x',y') = if y>y' then (x,y) else (x',y') fun item(nil,current,number_of) = sorted current number_of |item (h
::t, (x,y), number_of) = if h = x then item (t,(x,y+1),number_of)else
item (t,(h,1), sorted (x,y) number_of)in
insert_place (item(t, (h,1),(h,1))) end;
It is not 100% correct as the sorted function does not work properley!
I have found this code on an internet site but i do not understand how it works. I was told the steps to create a mode function in ml:
I am not very good at ml so i was unable to create my own mode function. Any help would be greatly appriciated.
Thank you