Advertisement
logicmoo

Untitled

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