Question: Why is the Bubble sort n^2 (considering that inner loop doesn't go all the way to n)? because O (1+2+3+...n) = n^2 Bubble sort is
Why is the Bubble sort n^2 (considering that inner loop doesn't go all the way to n)? because O (1+2+3+...n) = n^2 Bubble sort is not an n^2 sort because we have to count both odd and even exchanges bubble sort is n * i sort
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
