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

30th Jan 2021, 6:23 AM
Ayush
Ayush - avatar
8 Answers
+ 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 !
30th Jan 2021, 6:28 AM
Diksha Sharma
Diksha Sharma - avatar
+ 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
30th Jan 2021, 6:32 AM
Atul [Inactive]
+ 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.
30th Jan 2021, 6:35 AM
Arsenic
Arsenic - avatar
+ 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.
30th Jan 2021, 11:34 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
0
🇮🇳 R As it is mentioned C language so post the code in C language
30th Jan 2021, 6:49 AM
Atul [Inactive]
- 1
SORRY binary search index Not for this. 🙂
30th Jan 2021, 6:33 AM
SERG Starkov
SERG Starkov - avatar