0
What's the difference between Selection sorting and Bubble sorting ?
There are three types of sortings in C : 1) Insertion sort 2)Bubble sort 3) Selection sort
8 odpowiedzi
+ 2
1)In method of selection sorting , lowest value is selected and exchange it with the first value of array and now this process is applied to remaining elements and place the lowest in them at second place .
2) Bubble sort is simple one ! in it , two elements nearby are compared with each other if they are not in proper order then they are exchanged else they are left as it is !
+ 2
In selection sort the array is checked and the required value for the question is swapped. While in bubble sort for every step swapping takes place
+ 2
Actually there are a lot more sorting algorithms than just selection sort, bubble sort and insertions sort.
As of difference between them is considered then it is simply that by convention selection sorts searches for smallest element and puts in front(of unsorted array) whereas bubble sort checks adjecent elements to puts the largest one at the back of unsorted part of array.
+ 1
+ 1
Array is checked and required value for the value of the question is swapped in Selection sort. But in Bubble sort for every sort step swapping takes place.
0
🇮🇳 R As it is mentioned C language so post the code in C language
- 1
SORRY binary search index Not for this. 🙂