00:02
Hello student here, unsorted array is given 3 2 5 6 4 1.
00:07
Here i have to apply selection sort on the given array.
00:12
So selection sort i will apply here and after applying the selection sort i will get the sorted array.
00:21
So first iteration or after the first pass how the selection sort work? so selection sort first find the minimum element in the given list.
00:31
After that swapping is done.
00:34
At what position the element where to fit that number is swapped with the smallest number.
00:43
Here i have the list 3 2 5 6 4 1.
00:48
So here after selection sort applying and after one iteration or after one pass i get 1 2 5 6 4 3 how? first smallest element is find out.
01:00
So smallest element here is 1.
01:04
First smallest element here in this case is 1.
01:08
So 1 is swapped with 3 because 1 position is here according to the given array because it is the smallest one.
01:15
So 1 is swapped with 3.
01:18
So interchange of the position 1 come at the element which is 3 and 3 goes to the 1 position.
01:29
So they swapped themselves.
01:31
Now after finding the smallest element now i will go for the second iteration or the second pass.
01:39
Now my input array will be this.
01:41
Here 2 is the smallest in the remaining array.
01:45
I will not look here because i have already sorted this.
01:50
So i will go here and the remaining array will be this one 2 5 6 4 1.
01:57
So here 2 is at the position already.
02:01
It's sorted position...