%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% bubbleThroughOnce(Xs, Ys) :- 
%	
%    Ys is the resulted list after
%    	one iteration of comparisions and swapping
%	through out the list Xs.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Your code




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% bs(Xs, Ys, N) :- 
%    Ys is the resulting list after N "bubble-Through_Once"
%	iterations of comparisions and swapping through out the list
%	starting from the list Xs initially.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bs(Xs, Ys, 1) :-
	% Code for the base case of one iteration
	.
bs(Xs, Ys, N) :-
	% Code for the case with more than one iteration
	.



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% bs(Xs, Ys) :- 
%    Ys is an =< ordered permutation of the list Xs 
%    Ys is derived from Xs by bubble sort.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bs(Xs, Ys) :-
	% Just determine the length of Xs and as N then
	%	appropriately call bs(Xs, Ys, N) 
	.



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% len(List, N) :- N is the length of the list List.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
len([], 0).
len([_ | Ts], N) :- len(Ts, M), N is M+1.


