8.3.1 Sorting in Arrays | Selection Sort | C++ Placement Course

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

✤People will throw stones at you.
Don't throw them back.
Collect them all and build and empire.✤
Thank You A.D.

dippelarc
Автор

The things which looks tough in college are now looks easy . Thanks to Apna College Team

KrishnaGupta-ddmo
Автор

You guys are putting so much effort, without EXPECTING.
It makes me feel indebted to you guys and makes me work harder so your efforts don't go in vain

musicenjoyer
Автор

Will watch all these videos after my board examinations... Now came here to give a like for there hardwork👍👍

nikhillodhi
Автор

didi ka jo josh hota hai starting hai usse mereko motivation aa jati hai

sumitsharma
Автор

There is a small mistake in the video!!! If you look at the stepwise output(of array sorting) of the outer loop, then you will find that the working of the code is not the same as explained via the video!!!!

Here is the correct code for that:
int small, s, count;
for(int i=0; i<n-1;i++)
{
small= arr[i];
for(int j = i+1; j<n;j++)
{
if(arr[j]<small)
{
small = arr[j];
s = j;
count=1;
}
}
if(count ==1)
{
arr[s] = arr[i];
arr[i]= small;
}
count=0;
}

Basically, you have to swap the elements when you find the smallest element in the unsorted array. Not every time you find a smaller

THEELECTRICGUY
Автор

And also thankx to all teachers who are making such a great effort. And finally with the help of your videos, I become capable of solving the given problem. Thnxx sir and mam🔥

pradyumnmishra
Автор

frequency of video is just awesome
your consistency and hard work will pay off
best of luck everyone

mohdakib
Автор

Thank you very much sir, you are the one who's thinking is epic. May you stay happy all over your life and also very very thanks to your team.🙏

shabdsaran
Автор

Waiting for the day when educational videos will start trending in YouTube ❤️

rounakghosh
Автор

Aman Bhaiya your video is used to be so amazing ki kisi chote bacche ko bhi samajh aa jaye. My daughter is in 8 standard but infact she is able to understand the topic
Of higher classes and now learning c++. Hats off to you!!!

jayasrivastava
Автор

NOTE:
At 4:51 Instead of selection sort bubble sort logic is used but selection sort logic was explained.
Selection Sort Function is given below in c++:

void selectionSort(int a[], int n){

for(int i = 0; i < n-1; i++){
int min = i;
for(int j = i+1; j < n; j++){
if (a[min] > a[j])
min = j;
}
int temp = a[i];
a[i] = a[min];
a[min] = temp;
}
}

saranshyadav
Автор

The way you explain is amazing. you make the concepts so easy understand. Thanks

sachijoshi
Автор

This is a slow and understandable video ..Di pls keep this speed as it is😃💙

smrutikamble
Автор

teaching in such a simple way is awesome.

smile
Автор

learn this selection sort very easy and effective way from this channel.Thank you so much mam.

talhabinsiam
Автор

Thank u mam and aman bhaiya mam u're explanation helps a lot to understand the concept thank u mam

shivammaurya
Автор

Add more puzzles.. these are really interesting ❤️❤️

abhayranjan
Автор

mam in outer loop there should be i<n, if we take i<n-1 the last element is not considered and in the example as well the last element was at correct position is this assertion true?

ajayarjunwadkar
Автор

This does not seem like selection sort rather it is more like bubble sort but in reverse order. Because in selection sort u find the min element and swap it with the first element, so there is only one swap in each iteration, but in your case there are n, n-1, n-2... swaps with every iteration same as bubble sort.

saurabhshandilay