minhtrietphamtran

Untitled

Dec 4th, 2012
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.12 KB | None | 0 0
  1. insert(X, [], N, [X]).
  2. insert(X, L, 1, [X|L]).
  3. insert(X, [H|L1], N, [H|L2]) :- N > 1, N1 is N-1, insert(X, L1, N1, L2).
Advertisement
Add Comment
Please, Sign In to add comment