这两种排序算法相互比较如何工作?什么 他们之间的区别?谢谢
[1]:第一个代码?
asort(Xs, Ys):-asort1(Xs, [], Ys),!.
asort1([], Ys, Ys).
asort1([X|Xs],Ys0,Ys):-insert(Ys0,X,Ys1),asort1(Xs,Ys1,Ys).
insert([Y|Ys], X, [Y|Zs]):-Y < X, !, insert(Ys, X, Zs).
insert(Ys, X, [X|Ys]).
[2]:-第二个代码
bsort([X|Xs],[Y|Ys]):-
minimum(Xs,X,Y),efface([X|Xs],Y,Zs),bsort(Zs,Ys),!.
bsort([], []).
minimum([Y|Ys],X,Z):- Y =< X, !,minimum(Ys,Y,Z).
minimum([_|Ys],X,Z):- minimum(Ys,X,Z).
minimum([],X,X).
efface([Y|Xs],Y,Xs):-!.
efface([X|Xs],Y,[X|Zs]):-efface(Xs,Y,Zs).