Advertisement
Guest User

Untitled

a guest
Aug 19th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. bubblesort([], []).
  2. bubblesort([A], [A]).
  3. bubblesort([A|D], Ret) :-
  4. bubblesort(D, E),
  5. [B|G] = E,
  6. ((A =< B, Ret = [A|E]);
  7. (A > B, bubblesort([B,A|G], Ret))).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement