what is bubble shorting and selection shorting in an array in java .....explain both with a suitable program....
Answers
Answered by
2
Bubble sort is there in the pic hope it helps
Attachments:
![](https://hi-static.z-dn.net/files/d1c/1c21bcc559849c4cb428726969aabc89.jpg)
Anonymous:
the same book i also have
Answered by
5
Here is your answer
----------------------------------------------------------------------------------------------------------------
⭕ WHAT IS BUBBLE SHOOTING ?
=> The algorithm which which steps the list to sort , this compare the the pair of adjacent items.
1. some algorithms require only a few pointers.
2. Quicksort operates in-place on the data to be sorted.
3. Bubble sort is in the java and C++
----------------------------------------------------------------------------------------------------------------
EXAMPLE : -
printf("%d ", arr[i]);
printf("n");
}
// Driver program to test above functions
int main()
{
int arr[] = {64, 34, 25, 12, 22, 11, 90};
int n = sizeof(arr)/sizeof(arr[0]);
bubbleSort(arr, n);
printf("Sorted array: \n");
printArray(arr, n);
return 0;
}
( This program was wrote by my brother of 9 th standard )
----------------------------------------------------------------------------------------------------------------
⭕ What is selection shorting in an array in java.
=> The selection sort algorithm in an array by repeatedly finding the minimum element .
1. We can create a java program to sort array elements using selection sort.
2. We can search the lowest element and we can arrange then in proper order by selection shorting.
----------------------------------------------------------------------------------------------------------------
⭕ WHAT IS BUBBLE SHOOTING ?
=> The algorithm which which steps the list to sort , this compare the the pair of adjacent items.
1. some algorithms require only a few pointers.
2. Quicksort operates in-place on the data to be sorted.
3. Bubble sort is in the java and C++
----------------------------------------------------------------------------------------------------------------
EXAMPLE : -
printf("%d ", arr[i]);
printf("n");
}
// Driver program to test above functions
int main()
{
int arr[] = {64, 34, 25, 12, 22, 11, 90};
int n = sizeof(arr)/sizeof(arr[0]);
bubbleSort(arr, n);
printf("Sorted array: \n");
printArray(arr, n);
return 0;
}
( This program was wrote by my brother of 9 th standard )
----------------------------------------------------------------------------------------------------------------
⭕ What is selection shorting in an array in java.
=> The selection sort algorithm in an array by repeatedly finding the minimum element .
1. We can create a java program to sort array elements using selection sort.
2. We can search the lowest element and we can arrange then in proper order by selection shorting.
Similar questions