bubble sort we take an unsorted array for our example bubble sort takes ( time so we're keeping it short and precise bubble sort starts with very first two elementscomparing them to check which one is greater in this casevalue is greater than so it is already in sorted locations nextwe compare with we find that is smaller than and these two values must be swapped the new array should look like this next we compare and we find that both are in already sorted positions then we move to the next two values and we know then that is smaller hence they are not sorted we swap these values we find that we have reached the end of the array after one iterationthe array should look like this to be precisewe are now showing how an array should look like after each iteration after the second iterationit should look like this