Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open List;;
- let wzrost lista =
- let l2 = ref lista
- and wl = ref 0
- and wc = ref []
- and ol = ref 0
- and oc = ref []
- in
- while !l2 <> [] do
- begin
- if !ol = 0 || (hd !l2) > (hd !oc)
- then (oc := (hd !l2)::(!oc); ol := !ol + 1;)
- else (oc := []; ol := 0;);
- if !ol > !wl
- then wl := !ol; wc := !oc;
- l2 := (tl !l2);
- end;
- done;
- in !wc;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement