•In addition, the algorithm moves data
at most
the same number of times.
–So, including both comparisons and exchanges, we get
N(N-1) = N*N - N
•This can be summarized as a O(N2)
algorithm
in the worst case.
–We should keep in mind that this means
as our list
grows larger the performance will be dramatically reduced.