SHOW:
|
|
- or go back to the newest paste.
1 | - | bubblesort([], []). |
1 | + | bubblesort([A,DH|DT], Ret) :- D=[DH|DT], |
2 | - | bubblesort([A], [A]). |
2 | + | |
3 | - | bubblesort([A|D], Ret) :- |
3 | + | |
4 | ((A =< B, Ret = [A|E]); | |
5 | (A > B, bubblesort([B,A|G], Ret))). | |
6 | ||
7 | - | (A > B, bubblesort([B,A|G], Ret))). |
7 | + | bubblesort(A, A). |