?35E Use the bubble sort to sort 3, 1,5, 7, 4. showing the lists obtained at each step.

Solution Step 1 In this problem, we have to sort the list using the bubble sort technique. The list is given by 3, 1, 5, 7, 4 Step 2 First Phase (3, 1, 5, 7, 4 ) (1, 3, 5, 7, 4) Here, It compares the first two elements in the given list and swap since 3 > 1 (1, 3 , 7, 4) (1, 3 , 7, 4) Compare the next two elements in the given list (3 > 5).So, the condition is false. (1, 3, 5, 7, 4) (1, 3, 5, 7, 4) Compare the next two elements in the given list (5 > 7).So, the condition is false. (1, 3, 5, , 4) (1, 3, , 7) So, it compares the next two elements in the given list and swap since 7 > 4 Step 3 Second Phase (1, 3, 5, 4, 7) (1, 3, 5, 4, 7) Compare the next two elements in the given list (1 > 3).So, the condition is false. (1, 3 , 4, 7) (1, 3 , 4, 7) Compare the next two elements in the given list (3 > 5).So, the condition is false. (1, 3, 5, 4, 7) (1, 3, 4, 5, 7) So, it compares the next two elements in the given list and swap since 5 > 4 (1, 3, 4, , 7) (1, 3, 4, , 7) Compare the next two elements in the given list (5 > 7).So, the condition is false.