Bubble sort: how to calculate amount of comparisons and swaps
Number of swaps: The number of swaps in Bubble sort is exactly the number of inverted pairs, i.e. the number of pairs $(i,j):i &lt; j\wedge s[i]&gt;s[j]$. This number of pairs should be $(n/2-1)+(n/2-2) + ... + 1$ which is of the order of $n^2$.

Number of comparisons: This is of the order of $n$ times the number of passes through the list, which is of the order of $n$, as the element N needs to get to the end.

Therefore you have $\Theta(n^2)$ comparisons and swaps.