RosettaCodeData/Task/Singly-linked-list-Element-insertion/OCaml/singly-linked-list-element-insertion.ocaml
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

4 lines
165 B
Text

let rec insert_after a b = function
c :: cs when a = c -> a :: b :: cs
| c :: cs -> c :: insert_after a b cs
| [] -> raise Not_found