Question 2and 3 pleaseSolutionBubble sort void bubblesortint
Question 2and 3 please
Solution
Bubble sort
void bubblesort(int ar[])
{
for(int i=(ar.length-1);i>=0;i--)
{
for (int j=1;j<=i;j++)
{
if (ar[j-1]>ar[j])
{
int temp=ar[j-1];
ar[j-1]=ar[j];
ar[j]=temp;
}
}
}
}
Selection sort
Insertion sort
Merge sort
Quick sort
Sorting Summary
![Question 2and 3 pleaseSolutionBubble sort void bubblesort(int ar[]) { for(int i=(ar.length-1);i>=0;i--) { for (int j=1;j<=i;j++) { if (ar[j-1]>ar[j]) Question 2and 3 pleaseSolutionBubble sort void bubblesort(int ar[]) { for(int i=(ar.length-1);i>=0;i--) { for (int j=1;j<=i;j++) { if (ar[j-1]>ar[j])](/WebImages/15/question-2and-3-pleasesolutionbubble-sort-void-bubblesortint-1022792-1761529218-0.webp)