Add to Chrome
✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
In the "Optimized" Bubble Sort, what is the purpose of the swapped flag?
To change the sort order from ascending to descending
To swap elements without using a temporary variable
To detect if the array is already sorted and stop the algorithm early
To count the total number of swaps
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!