Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bubblesort([], []).
- bubblesort([A], [A]).
- bubblesort([A|D], Ret) :-
- bubblesort(D, E),
- [B|G] = E,
- ((A =< B, Ret = [A|E]);
- (A > B, bubblesort([B,A|G], Ret))).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement