Bubble Sort
1. Which of the following statements is true for Bubble Sort in ascending order?
2. To sort an array in descending order using Bubble Sort, when should two adjacent elements be swapped?
3. Consider the following array:
A = [9, -1, -10, 9*, 2]
Here, '*' distinguishes the two 9s so that their relative order can be tracked while sorting. Which of the following represents the sequence of arrays after successive complete passes of Bubble Sort in ascending order?
A = [9, -1, -10, 9*, 2]
Here, '*' distinguishes the two 9s so that their relative order can be tracked while sorting. Which of the following represents the sequence of arrays after successive complete passes of Bubble Sort in ascending order?
4. What is the primary purpose of comparing adjacent elements in Bubble Sort?
5. What is the result of the first complete ascending Bubble Sort pass on A = [4, 1, 3, 2]?
6. If no swaps occur during a complete pass of Bubble Sort, what does this indicate?
7. Which statement correctly describes the role of the outer loop in Bubble Sort?
8. In ascending Bubble Sort, after the first complete pass, which element is guaranteed to be in its final position?
9. Which statement about Bubble Sort is correct?