In Bubble Sort there is a loop within a loop. Hence, we can say that the Best Case and the Worst Case is O(n^2)
for(int x=0; x<n; x++) { for(int y=0; y<n-1; y++) { if(array[y]>array[y+1]) { int temp = array[y+1]; array[y+1] = array[y]; array[y] = temp; } } }