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

  Рет қаралды 1,052,799

Apna College

Apna College

3 жыл бұрын

Notes of this video: drive.google.com/file/d/1zkOX...
Apni Kaksha Instagram: / apnikaksha
Apni Kaksha Telegram: t.me/apnikakshaofficial

Пікірлер: 1 100
@dippelarc8997
@dippelarc8997 3 жыл бұрын
✤People will throw stones at you. Don't throw them back. Collect them all and build and empire.✤ Thank You A.D.
@ChiruVishnoi18082003
@ChiruVishnoi18082003 3 жыл бұрын
kzbin.info/www/bejne/sKO4nImln6h5Zs0
@sauravrawat5587
@sauravrawat5587 3 жыл бұрын
😂😂
@shrutidas359
@shrutidas359 3 жыл бұрын
why people will throw stones at her🤔🤔🤔
@ashutoshharma
@ashutoshharma 3 жыл бұрын
they had us in the first half
@starkendeavours7072
@starkendeavours7072 3 жыл бұрын
Lovely...dil khush ho gya ye sunke❤️❤️❤️
@THEELECTRICGUY
@THEELECTRICGUY 3 жыл бұрын
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
@sakshamarora9122
@sakshamarora9122 3 жыл бұрын
I think the code in the video is correct. If we aren't able to find the smallest element then there will be no swapping because we have a if statement judging it. And also the swapping takes place inside the scope of if statement.
@sakshamarora9122
@sakshamarora9122 3 жыл бұрын
@@THEELECTRICGUY wait I need to code it now.
@_rahulsain
@_rahulsain 3 жыл бұрын
@@THEELECTRICGUY whats the difference , it will take same time
@THEELECTRICGUY
@THEELECTRICGUY 3 жыл бұрын
@@_rahulsain Selection sort, bubble sort and insertion sort have same time complexity(ie O n^2)but have different internal working according to the theory. The code you write should clearly define which sorting method you are using.
@_rahulsain
@_rahulsain 3 жыл бұрын
@@THEELECTRICGUY you didnt change the logic, you changed the code a bit but it is working as in video i see no difference
@shreyaschavhan5522
@shreyaschavhan5522 3 жыл бұрын
Notes - Selection Sort - Concept - [1:10] Selection Sort - Algorithm - [3:50] Selection Sort - Code - [4:40] Brain Teaser - [6:45]
@ritikshrivastava9442
@ritikshrivastava9442 3 жыл бұрын
thankyou bhai tu har video me ye hi comment mar raha hai
@shubhsYT
@shubhsYT 2 жыл бұрын
@@ritikshrivastava9442 nalla h na islie
@subhanjanbasu4642
@subhanjanbasu4642 2 жыл бұрын
@@shubhsYT tera baap jaisa
@sanketsingh5555
@sanketsingh5555 2 жыл бұрын
@@subhanjanbasu4642 na tere baap jaisa
@science2564
@science2564 2 жыл бұрын
@@sanketsingh5555 na tere baap jaisa teri profile se he lg rha hai
@nikhillodhi7427
@nikhillodhi7427 3 жыл бұрын
Will watch all these videos after my board examinations... Now came here to give a like for there hardwork👍👍
@ChiruVishnoi18082003
@ChiruVishnoi18082003 3 жыл бұрын
Me to. From which board are you
@ChiruVishnoi18082003
@ChiruVishnoi18082003 3 жыл бұрын
I am from cbse board
@Pratyush_Srivastava24
@Pratyush_Srivastava24 3 жыл бұрын
CBSE , same here
@soniabhatia9853
@soniabhatia9853 3 жыл бұрын
Same
@krishjani9629
@krishjani9629 3 жыл бұрын
Same here.... From Gujarat boards
@saranshyadav66
@saranshyadav66 2 жыл бұрын
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; } }
@khushinautiyal1858
@khushinautiyal1858 Жыл бұрын
doing god's work
@aimld28_utkarshpandey41
@aimld28_utkarshpandey41 Жыл бұрын
kzbin.info/www/bejne/rpSzd4h5nZWdipI Bubble sort is this bro!
@coderfek
@coderfek 10 ай бұрын
Good job. This is hell of a confusion .
@nitikadhiman5068
@nitikadhiman5068 10 ай бұрын
was looking for this comment only... galat code btaya hai
@__idyllist
@__idyllist 8 ай бұрын
Actually this one is right
@musicenjoyer4202
@musicenjoyer4202 3 жыл бұрын
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
@delhuniversity
@delhuniversity 2 жыл бұрын
can you please find error in the prog
@nepaliladka8526
@nepaliladka8526 2 жыл бұрын
@Harshil Pandey #include using namespace std; int main() { int n ; cin>>n; int arr[n]; for(int i=0;i>arr[i]; } for (int i = 0; i < n-1; i++) { int min = i; for (int j = i + 1; j
@pradyumnmishra3459
@pradyumnmishra3459 3 жыл бұрын
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🔥
@Vishwadeep_ceo
@Vishwadeep_ceo 3 жыл бұрын
to make This 8 :32minute of video it has taken atlest 2 days for the whole process like animation , index, etc. Give a big like for all the educators of apni kaksha . 👇 👇
@ApnaCollegeOfficial
@ApnaCollegeOfficial 3 жыл бұрын
It takes us 2 days to make a 7-8 min video. Script + Shoot + Edit + Animate + Edit + Review + Notes
@KodiLearn
@KodiLearn 3 жыл бұрын
2 hrs mai toh mere jaisa simple videos vi complete nahi hota 😂🤣
@pradhumangupta8469
@pradhumangupta8469 3 жыл бұрын
Bhai 2hr really ?? Very bad guess, it took more than 1 working day for such short video ( I know coz I m plus student and he told us in casual talks)
@Vishwadeep_ceo
@Vishwadeep_ceo 3 жыл бұрын
@@ApnaCollegeOfficial yes sir . I totally agree with u
@niladriroy1665
@niladriroy1665 3 жыл бұрын
@@Vishwadeep_ceo edit kar diya.... 2hrs ko 2 days kar diya. 🤣🤣
@KrishnaGupta-dd1mo
@KrishnaGupta-dd1mo 3 жыл бұрын
The things which looks tough in college are now looks easy . Thanks to Apna College Team
@rounakghosh469
@rounakghosh469 3 жыл бұрын
Waiting for the day when educational videos will start trending in KZbin ❤️
@AbhishekKumar-nz9dn
@AbhishekKumar-nz9dn 2 жыл бұрын
india me chapri bohot bhare hue hai ,jinka education se koi lena dena nhi hai .
@hatcoder
@hatcoder Жыл бұрын
I will bring that day buddy 🤞🤞
@shabdsaran5131
@shabdsaran5131 3 жыл бұрын
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.🙏
@arunkumarsingh2724
@arunkumarsingh2724 9 ай бұрын
Not sir she's madam😂😂😂
@sumitsharma6738
@sumitsharma6738 3 жыл бұрын
didi ka jo josh hota hai starting hai usse mereko motivation aa jati hai seriously.......
@mohdakib8448
@mohdakib8448 3 жыл бұрын
frequency of video is just awesome your consistency and hard work will pay off best of luck everyone
@jayasrivastava4220
@jayasrivastava4220 3 жыл бұрын
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!!!
@devashreesharma3865
@devashreesharma3865 2 жыл бұрын
The girls that explains the concept is the best. She explains so well better than anybody here. And the way she explains makes me more interested in the subject and would want to do better and better day by day.
@talhabinsiam4757
@talhabinsiam4757 3 жыл бұрын
learn this selection sort very easy and effective way from this channel.Thank you so much mam.
@saurabhshandilay8261
@saurabhshandilay8261 3 жыл бұрын
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.
@user-zw1xp7it3o
@user-zw1xp7it3o 3 жыл бұрын
Yes you are right ... they have used another sorting algorithm as Selection Sort
@rishaadkhan6995
@rishaadkhan6995 3 жыл бұрын
actually, they have used selection sort but with two pointers.
@C_mee
@C_mee 2 жыл бұрын
instead of finding a minimum of all the element in second loop, here the minimum is itself being stored in arr[i], this works fine but this is not in adherence to the theory of selection sort.
@adityarawat9338
@adityarawat9338 Жыл бұрын
@@rishaadkhan6995 where is the pointers?
@sachijoshi9161
@sachijoshi9161 2 жыл бұрын
The way you explain is amazing. you make the concepts so easy understand. Thanks
@__idyllist
@__idyllist 8 ай бұрын
In coding you have to learn how to rewrite the concept in code. Probably/almost all are aware about the concept. But don't know how to implement and she has written a wrong code. Once you try by yourself you'll know! Thank me later!
@ajayarjunwadkar4808
@ajayarjunwadkar4808 3 жыл бұрын
mam in outer loop there should be i
@smile8510
@smile8510 2 жыл бұрын
teaching in such a simple way is awesome.
@shivammaurya3451
@shivammaurya3451 3 жыл бұрын
Thank u mam and aman bhaiya mam u're explanation helps a lot to understand the concept thank u mam
@abhayranjan5878
@abhayranjan5878 3 жыл бұрын
Add more puzzles.. these are really interesting ❤️❤️
@nickrathee8891
@nickrathee8891 Жыл бұрын
@ 8:23 ----- (15 buyed) + (5 from wrapper of 15)+ ( 1 choco from 3 wrapper 2 wrapper left) + (buy 1 additional to get 1 wrapper so total we can have 3 wrapper) + (1 choco from 3 wrapper) - total = 23
@pranayakhand1535
@pranayakhand1535 3 жыл бұрын
You Guys are Awesome yrr ... Your Video are so much helpfull for us...keep going guys ❤️
@LASTWOLF
@LASTWOLF 2 жыл бұрын
Write an algorithm to find the longest sequence in order(ascending) from the given array: {23, 65, 15, 43, 10, 25, 35, 42, 18} and print the sequence. Write a C program for the same.
@smrutikamble7255
@smrutikamble7255 3 жыл бұрын
This is a slow and understandable video ..Di pls keep this speed as it is😃💙
@LifewRoshu
@LifewRoshu 2 жыл бұрын
Thank you so much AMAN BHAIYA and the whole team of APNA COLLEGE ❤️❤️✨✨
@ggv-informationtechnology6645
@ggv-informationtechnology6645 2 жыл бұрын
Please have a look at selection sort algorithm. It seems that algorithm doesn't match with your implemented code in the given notes
@kiranp5828
@kiranp5828 3 жыл бұрын
These guys are just amazing.And they were doing such a great work. They were giving a very quality education for free. Please guys support them all.🙏🙏🙏
@aryansharma-wf8sn
@aryansharma-wf8sn 3 жыл бұрын
Didi you make such a difficult topic so easy 😊🥰
@prernachoudhary2197
@prernachoudhary2197 3 жыл бұрын
Keep the spiritual high bhiya and team ...may god bless you.. And brain teaser was amazing ....
@vidneshsharma9194
@vidneshsharma9194 2 жыл бұрын
Easy explaintion thanks Di ! 😊😊 , You R best teacher in the 🌍 😇...
@sarthaknitnaware
@sarthaknitnaware 3 жыл бұрын
Awesome explanation!😍😍
@AkhilKumar-zo4rh
@AkhilKumar-zo4rh 3 жыл бұрын
Bhaiya kisi din apni kaksha + apna college ke sabhi teachers ke saath ek video bnao naa...(face reveal and their intros)....vo sb ki kaafi mehnat kr rhe h unka thoda fame to bnta h...
@suman-majhi
@suman-majhi 3 жыл бұрын
He is following Robert Kiyosaki rules
@vathsan3906
@vathsan3906 3 жыл бұрын
@@suman-majhi what is that?
@suman-majhi
@suman-majhi 3 жыл бұрын
@@vathsan3906author of Rich dad, poor dad....a book...just search for it bro
@NITISHKUMAR-tr9bc
@NITISHKUMAR-tr9bc 3 жыл бұрын
@Akhil Kumar seeedhe seedhe bolo na bhai ki jo mam padha rhi hai usko dekhna hai 😂😂😂😂😂😂😂😂😂😂😂😂😂
@vathsan3906
@vathsan3906 3 жыл бұрын
@@suman-majhi which rule?
@jagjeevankashid
@jagjeevankashid 6 күн бұрын
This is the correct implementation you have implemented the bubble sort :- for(int i=0;i
@sahilrana11
@sahilrana11 3 жыл бұрын
thankyou sooo much it helped me a lot. you all are awesome more power to u.
@tusharnath9402
@tusharnath9402 3 жыл бұрын
Urvi Di teaches so damn good. All the concepts gets cleared. Thank you so much, Di and Aman Bhaiyya and team. Loads of luck and love to you!
@manthanpatil2268
@manthanpatil2268 2 жыл бұрын
Dear Teachers of Apna college, Please update the code as the code given in the video is of Bubble sort and not of Selection sort 🙂🙂
@ADEEBARASHIDBAI
@ADEEBARASHIDBAI Жыл бұрын
try this code #include using namespace std; int main() { int n; cin>>n; int arr[n]; for(int i=0;i>arr[i]; } int temp=0; for(int i=0;i
@cosmicAK
@cosmicAK Жыл бұрын
yes
@jeetendranathmishra3701
@jeetendranathmishra3701 Жыл бұрын
exactly
@muradahmad9357
@muradahmad9357 Жыл бұрын
literally I've been thinking that what just really happened🥲
@fannypack7705
@fannypack7705 Жыл бұрын
It's selection sort dude
@mohammedsayeed330
@mohammedsayeed330 3 жыл бұрын
mam ki voice sunke hi dil bargaya 😍
@ganeshnaik778
@ganeshnaik778 3 жыл бұрын
seems the journey is big with apna college
@dits745
@dits745 3 жыл бұрын
Thank you Aman bhaiya😀😊
@rutvikrana512
@rutvikrana512 3 жыл бұрын
We can use inbuilt method swap(a,b) to swap two elements. 👌
@conquerworld_in
@conquerworld_in 3 жыл бұрын
One of the best series BUT just a simple suggestion, please show us a solution with debugging the code so that we can get a better idea, but now as series is fully made please just put a video on how to debug program so that every one of us can do that and understand every code with full Efficiency.
@shivaaysinghrajput4760
@shivaaysinghrajput4760 3 жыл бұрын
Thanks for adding puzzle questions...
@simranarora3864
@simranarora3864 2 жыл бұрын
When I did dry run- When i = 1 and j loop was going on from 2,3,4,5 Three swapping took place Which is not the case of selection sort you told in theory
@manavkampani8367
@manavkampani8367 3 жыл бұрын
Code for the puzzle at the end: #include using namespace std; int main() { cout n; int rate; cin>>rate; int total_chocs=n; int rem_wraps{0}; int new_wraps=n; int new_chocs{0}; while(new_wraps+rem_wraps>=3) { new_chocs=(new_wraps+rem_wraps)/3; rem_wraps=(new_wraps+rem_wraps)%3; new_wraps=new_chocs; total_chocs=total_chocs+new_chocs; } cout
@SajjadAhmed-lc2dr
@SajjadAhmed-lc2dr 2 жыл бұрын
behtarenn
@ayushpathak1638
@ayushpathak1638 2 жыл бұрын
this one is better i think #include using namespace std; int main(){ int count=0; for(int i=0;i
@mdtipusultan7889
@mdtipusultan7889 3 ай бұрын
Chocolate buying calculation was awesome 👍👍.
@freemusi2015
@freemusi2015 3 жыл бұрын
Sir please give brain teaser in every video.....Thank you❤️❤️❤️❤️❤️
@bcsmadhavanand
@bcsmadhavanand 2 жыл бұрын
End part puzzle was amazing 💥
@codingWorld709
@codingWorld709 2 жыл бұрын
Yeah really, I have spend some time and found a general formula to calculate any numbers of chocolate.... 💓💓💓
@sameerraj5800
@sameerraj5800 3 жыл бұрын
This was an easy brain teaser. I solved it within 10 seconds.
@rahuldravid288
@rahuldravid288 10 ай бұрын
Han bhai boht bdiya cool lgra hai bohttt💥
@sameerraj5800
@sameerraj5800 10 ай бұрын
@@rahuldravid288 Are bhai itne purane comment pe reply kiya😂
@shardulrastogi4369
@shardulrastogi4369 2 жыл бұрын
Waah maza aagya, once upon a time, I used fear with this!
@Dev_Bhattacharya
@Dev_Bhattacharya 3 жыл бұрын
love you bhaiya and its team
@jaymeenjogiya8798
@jaymeenjogiya8798 3 жыл бұрын
I think there is a conflict in the theory of the selection sort vs the code , code looks like bubble sort
@rounaksharma9091
@rounaksharma9091 2 жыл бұрын
yea i feel the code is wrong ,its bubble sort code
@rakesharigela7337
@rakesharigela7337 2 жыл бұрын
@@rounaksharma9091 yes
@hhhhhhhhh963
@hhhhhhhhh963 2 жыл бұрын
Agreed
@AbhishekKumar-nz9dn
@AbhishekKumar-nz9dn 2 жыл бұрын
she didn't also clarify by telling us the explanantion of the code
@hhhhhhhhh963
@hhhhhhhhh963 2 жыл бұрын
@@AbhishekKumar-nz9dn Explanation is correct, Code is not upto the flowchart provided by GFG. We can't expect everything as top notch from a well structured free course😂
@AnkitKumar-zx9nh
@AnkitKumar-zx9nh 3 жыл бұрын
20th video is private , what happened to that one
@shoebilyas5368
@shoebilyas5368 3 жыл бұрын
lol good one XD
@hassaanraheem5644
@hassaanraheem5644 3 жыл бұрын
Wo Kal public hogi bubble sort topic hai.
@hassaanraheem5644
@hassaanraheem5644 3 жыл бұрын
@KZbinr Muntazir Bhai KZbin Mai agr aap chahte ho ko koi video specific time pr upload ho tu aap timer lgakr chor dety ho or wo video playlist mai jaga leleti hai lkin private rehti hai tb tk jb tk uploadation ka time nhi hojata.
@SHUBHAM23P
@SHUBHAM23P 3 жыл бұрын
thank you so much for your efforts sir
@035asadali8
@035asadali8 2 жыл бұрын
when i start programming and see these videos ,i thought wth is happening now i can understand so easily .
@Risheendra
@Risheendra 3 жыл бұрын
I did my Btech in IT from private college, but no one taught me like this. Thanks mam..you are best.
@ayushmansharma1402
@ayushmansharma1402 3 жыл бұрын
Ma'm it is not a selection sort ,yes your explanation is correct for the selection sort but u had did coding of bubble sort in the video , because we can see that in the coding ,the continious swapping is going on for each iteration. But if we talk about selection sort , than the swapping occurs only 1 time for each iteration ...... // selection sorting ....... #include using namespace std; int main(){ int n; cout
@top7gram567
@top7gram567 2 жыл бұрын
I agree with you bro
@sevenhours1137
@sevenhours1137 2 жыл бұрын
really awesome content guys....
@niknurulhuda3018
@niknurulhuda3018 2 жыл бұрын
thank you sister. im finally done with my coding
@AkibHussain
@AkibHussain 3 жыл бұрын
Concentrate all your thoughts on the task at hand. The sun's rays do no burn untill brought to a focus.
@jagritiyadavv
@jagritiyadavv 2 жыл бұрын
Nice quote.
@doitwithease4111
@doitwithease4111 3 жыл бұрын
guys is there any person following this course seriously and would like to help me in clearing some doubts....i mean we can discuss our doubts related to this course cuz i am doing C++ for the very first time and i encounter doubts and there is no one to clear them....i have many doubts in video 6.3.......
@pranayraj8945
@pranayraj8945 3 жыл бұрын
What kind of doubts do you have..??
@shauryarana502
@shauryarana502 3 жыл бұрын
I can try to ans.
@adityaswarup4011
@adityaswarup4011 3 жыл бұрын
yup...i am an expert .. feel free to ask your doubts???
@rishikeshkumar7275
@rishikeshkumar7275 3 жыл бұрын
Yes
@doitwithease4111
@doitwithease4111 3 жыл бұрын
@@pranayraj8945 in video 6.3 bhaiya explained decimal to binary conversions etc....i couldnt understand all those things....if u r on instagram then kindly add me "aakarshmiglani" this is my insta id.....we can discuss over there....or can even call if u r comfortable with it
@sanjanasinha7477
@sanjanasinha7477 3 жыл бұрын
Thanks bhaiya for uploading videos this videos are just awesome bhaiya please upload video on mca intrance exam also.
@shubhambhardwaj8894
@shubhambhardwaj8894 3 жыл бұрын
Awesome explanation ❤
@vaibhavkesarwani2687
@vaibhavkesarwani2687 3 жыл бұрын
You don't have to swap with the every small element you get. We have to first find the index of the smallest element and then do the swap with it. Please do the correction.
@pritamsarkar3371
@pritamsarkar3371 2 жыл бұрын
exactly
@priority_cute
@priority_cute 2 жыл бұрын
Yeah
@nandhinireddy2980
@nandhinireddy2980 Жыл бұрын
Yes
@sasikirane1638
@sasikirane1638 3 жыл бұрын
May be the code was of bubble sort instead of selection sort🙏
@amantarar9077
@amantarar9077 2 жыл бұрын
iss comment ko top parr lao,otherwise padhne walon ko confusion hoegi
@AbhishekKumar-nz9dn
@AbhishekKumar-nz9dn 2 жыл бұрын
yes bhai ,definately gadbad hai
@rabiahafeez-cg8hz
@rabiahafeez-cg8hz 27 күн бұрын
Thanks ma'am I've seen now this video and code is clear running
@muhammadtamour2286
@muhammadtamour2286 Жыл бұрын
While doing task I am not understanding it quite properly but after watching this video it makes me too much comfortable 😉
@phatakom
@phatakom 3 жыл бұрын
Wait, the code looks like of bubble sort not selection sort
@top7gram567
@top7gram567 2 жыл бұрын
I agree
@udittatisar5336
@udittatisar5336 2 жыл бұрын
Wahi to Yaar
@husler7424
@husler7424 2 жыл бұрын
so its actually a Bubble sort code? and do we need to write another for Selection sort?
@pavankumar-gp9zx
@pavankumar-gp9zx 2 жыл бұрын
i think it not exactly a bubble sorting code, see the next video then will get clarity
@yagamilight08
@yagamilight08 2 жыл бұрын
nahi...selection sort me minimum ko baar baar "select" karte hai....bubble sort me minimum khud hi "bubble up" hota hua start me aa jata hai...different hai
@rutvikrana512
@rutvikrana512 3 жыл бұрын
Selection sort in this video ....💕 Left in Queue: - Insertion sort - Bubble sort - Merge sort - Quick sort - Heap sort - Counting sort - Radix sort - binary tree sort - and many more .....
@Samconery
@Samconery Жыл бұрын
Nice lecture. But one thing I would like to add is you need to explain the WHY? For example why do we end the first loop before n-1 and why we start the second loop after the first element. Computer Science students will know why because they can cross learn with college but other students will not be able to. The why is important to understand to remember the concepts forever otherwise it will cause confusion far into the future. This was a relatively simpler topic but more advanced will require the need to understand WHY?
@geetanshagrawal
@geetanshagrawal 3 жыл бұрын
Please also explain about time complexity for the sorting algorithm
@Saurabh-jv7pf
@Saurabh-jv7pf Жыл бұрын
I'm totally confused with the code. It's like a bubble sort but it's neither bubble sort nor selection sort. But the code works very well.
@relaxandsleepmusic809
@relaxandsleepmusic809 2 жыл бұрын
by the way last problem was amazing 🙌
@rudrantukirde8743
@rudrantukirde8743 2 жыл бұрын
Solution is wrong
@catdog3264
@catdog3264 Жыл бұрын
@@rudrantukirde8743 did u understand about the last one chocolate. how she brought extra chocolate. plss explain
@amanagnihotri6794
@amanagnihotri6794 Жыл бұрын
Mind-blowing 😍
@shivam3628
@shivam3628 10 ай бұрын
amazing explanation mam 😊
@isitMaaz
@isitMaaz 3 жыл бұрын
I thought we have to code the brain teaser and I started doing that.....lol
@aryanagrawal689
@aryanagrawal689 3 жыл бұрын
tu bits m hai ?
@isitMaaz
@isitMaaz 3 жыл бұрын
@@aryanagrawal689 nhi
@nagatouchiha6883
@nagatouchiha6883 2 жыл бұрын
Muzhe bhi yahi laga.. 1hr barbad hogaya mera😂🤣
@manansinghal5634
@manansinghal5634 3 жыл бұрын
THIS IS NOT EXACTLY SELECTION SORT IN SELECTION SORT THE WE DO NOT CHANGE EVERY ELEMENT SMALLER THAN THE I INDEX....WE JUST HAVE TO CHANGE THE SMALLEST. ELEMENT WITH I INDEX.......PROVE-SUPPOSE THE INITIAL ARRAY IS 45 12 23 51 19 8 ......but after the completion of j loop for the first time the array will be 8 45 23 51 19 12 but the array should be 8 12 23 51 19 45.
@AbhishekKumar-nz9dn
@AbhishekKumar-nz9dn 2 жыл бұрын
yes ,gadbad hai
@sandeshwar7407
@sandeshwar7407 3 жыл бұрын
After buying all those 22 chocolates, I'll give it to you ma'am😉😋😍
@ShubhamSharma-nn3ly
@ShubhamSharma-nn3ly 3 жыл бұрын
Amazing explanation
@user-nm4vn9tq5o
@user-nm4vn9tq5o 2 жыл бұрын
Wtf man, this code isn't sorting the array.Irony is how confidently you post this video without even cross checking.
@ydafukomi
@ydafukomi Ай бұрын
I tried it, and guess what? IT WORKED. Maybe just double check your code before confidently posting shitty comments from next time on❤
@Fun.Adda143
@Fun.Adda143 29 күн бұрын
Bhai ye selection sort ke jagah bubble sort ka code laga di hai ye galat hai
@sarthaknitnaware
@sarthaknitnaware 3 жыл бұрын
Didi ki voice😍❣
@rahulsinghchauhan5634
@rahulsinghchauhan5634 2 жыл бұрын
This is very helpful for me👍👍
@VictorBose-wt7xf
@VictorBose-wt7xf 3 жыл бұрын
nice problem. Was able to solve it in one go.
@pranavchoudhary6491
@pranavchoudhary6491 3 жыл бұрын
Bhaiya just a reminder( I know you definately remeber) Please upload the notes of previous video They aren't uploaded yet 🙏🙏
@kartikeyadubey1266
@kartikeyadubey1266 3 жыл бұрын
Yes yes bhaiya , where can we find those notes.
@ojasahirrao3287
@ojasahirrao3287 2 жыл бұрын
In the second step, 23 is less than 45, so according to your code they both should get swapped. How come 12 is getting swapped with 45? There is no code written to find the smallest number in [45, 23, 51, 19, 12]
@ashutoshsagar837
@ashutoshsagar837 Жыл бұрын
yes, no code is written to find the minimum here as according to the definition we have to find the minimum and then swap it with the beginning element of the unsorted array.
@divyamharbola6876
@divyamharbola6876 2 жыл бұрын
Everyone do like man, They are providing Platinum for free.
@salahuddin13
@salahuddin13 9 ай бұрын
Time:[6:42] (Solution) #include using namespace std; int main(){ int tk,chocolates,total=0; cin>>tk; int wrappers=tk; total=tk; while (wrappers>=3) { chocolates = wrappers/3; // (14/3)=4 (6/3)=2 0 int rem= wrappers%3; //2 0 total+=(chocolates); //14 14+4=18 18+2=20 wrappers=chocolates+rem; // 4+2=6 } cout
@uditangshuchakraborty3102
@uditangshuchakraborty3102 9 ай бұрын
thanks
@tarunparashar4505
@tarunparashar4505 3 жыл бұрын
Liked the video and was the first viewer without even being in college 😂😂😂. Btw class 12th student.
@vaibhavagrawal6702
@vaibhavagrawal6702 3 жыл бұрын
Mam i think apne Selection sort ki coding me apne bubble sort ki coding btadi...
@chirantanacharyya822
@chirantanacharyya822 3 жыл бұрын
Yeah you are absolutely right
@ayushmaankashyap6788
@ayushmaankashyap6788 Жыл бұрын
Very adorable voice mam🥰
@aayshachouhan7985
@aayshachouhan7985 Жыл бұрын
My Sir taught me in very difficult way ,but u make it easy..Thanks
@parthpanchal815
@parthpanchal815 Жыл бұрын
Bro this is not the correct code of selection sort it is bubble sort
@rahulprasad3575
@rahulprasad3575 3 жыл бұрын
selection sort code was different as it explained
@sampadsadhu4371
@sampadsadhu4371 3 жыл бұрын
Yes I was confused at first
@yashchauhan7221
@yashchauhan7221 3 жыл бұрын
it is bubble sort which is shown in code not selection
@chiragkakwani3174
@chiragkakwani3174 3 жыл бұрын
No 1 step has been missed
@ramakp34
@ramakp34 3 жыл бұрын
@@yashchauhan7221 can u tell the code of selection sort
@yashchauhan7221
@yashchauhan7221 3 жыл бұрын
@@ramakp34 Ofcourse Dude #include using namespace std; int main() { int tot, arr[50], i, j, temp, small, chk, index; couttot; cout
@nikitasharma2069
@nikitasharma2069 3 жыл бұрын
For those pals who noticed that the code doesn't match with the explaination. Here's the correct code of selection sort: #include using namespace std; int main(){ int n; cin>>n; int array[n]; for (int i = 0; i < n; i++) { cin>>array[i]; } for (int i = 0; i < n; i++) { int min = array[i]; int loc = i; for (int j = i+1; j < n; j++) { if (min > array[j]) { min = array[j]; loc = j; } } int temp = array[i]; array[i] = array[loc]; array[loc] = temp; } for (int i = 0; i < n; i++) { cout
@manthanpatil2268
@manthanpatil2268 2 жыл бұрын
Thanks btw!
@nikitagaikwad2788
@nikitagaikwad2788 2 жыл бұрын
Thx dear
@GULLAPUDILIKITHBCE
@GULLAPUDILIKITHBCE 2 жыл бұрын
what is the use of min variable? #include using namespace std; int main() { int arr[5]={3,4,2,1,-100}; for(int i=0;i
@shaikwaseemahmed.5510
@shaikwaseemahmed.5510 3 жыл бұрын
Thanks date to date videos thanks aman dattarwal and team
@anuragkumarsharma3926
@anuragkumarsharma3926 2 жыл бұрын
This code have one problem , We don't have to swap everytime when we get smaller number but only when we get smallest element in the unsorted array. according to the code output will be i guess {3,6,2,7,9}. Correct me guys if i am wrong
@kashyapanuragi8987
@kashyapanuragi8987 2 жыл бұрын
Ni bhai code sahi h Lekin lekin har baar swap karne ki jaroorat ni h, keval jab minimum mile tab short kar sakte the
@user-nm4vn9tq5o
@user-nm4vn9tq5o 2 жыл бұрын
Yes bro you are right, their code isn't working
@usmanaliansari5223
@usmanaliansari5223 2 жыл бұрын
Code galat hai Selection sort ka
@i_mchick5311
@i_mchick5311 3 жыл бұрын
we've only 15 RS. so we invested it to purchase 15 chocolates , then we purchased 15/3=5 more chocolates from wrappers . again from 5 chocolates we purchased 1 more ch leaving behind 2 wrappers. Total= 15+5+1=21 ch (2 wrappers left) Now tell me how can u purchase the last chocolate without having even a penny since u mentioned in the beginning we had 15 Rs only. ????? :)
@_AKASHNAIR
@_AKASHNAIR 2 жыл бұрын
its mostly an error in their script ,and its acceptable they were trying to maintain quality content while without comprmising on time
@meme-qw6hl
@meme-qw6hl 2 жыл бұрын
Last chocolate wrapper+ 2 left wrapper =3wrappers=1chocolate
@meme-qw6hl
@meme-qw6hl 2 жыл бұрын
#Brain teaser# include using namespace std; int main() { int chocolate,price,wp; cin>>chocolate>>price>>wp; int c=chocolate/price; int eat=0; int m=0; while(c>0) { eat=eat+c; m=m+c; c=m/wp; m=m%wp; } cout
@_AKASHNAIR
@_AKASHNAIR 2 жыл бұрын
@@meme-qw6hl so in the end only 21 choclates and 2 wrappers will be left right?
@meme-qw6hl
@meme-qw6hl 2 жыл бұрын
@@_AKASHNAIR no 22 chocolate and 0 wrapper
@vinayaktripathi287
@vinayaktripathi287 2 жыл бұрын
For all comments on the point that code looks like bubble sort. More like she used bubble sort to get the minimum value for selection sort. The only difference was the starting point of first for loop which decreased time complexity compared to bubble sort.
@shreyapanwar3800
@shreyapanwar3800 2 жыл бұрын
I don't get it why are you using "n-1" in the first for loop{for(int i=0;i
@itshiraljain
@itshiraljain 2 жыл бұрын
There is some mistake in selection sort code, we aren't optimizing no. of swaps, the correct code should be like this: for (int i = 0; i < n-1; i++) { int min = i; for (int j = i+1; j < n; j++) { if (arr[j] < arr[min]) { min = j; } } if (min != i) { swap(arr[min], arr[i]); } }
@harharmahadev1038
@harharmahadev1038 2 жыл бұрын
can you explain what you meant by saying that and this part... if (min != i) { swap(arr[min], arr[i]); }
@itshiraljain
@itshiraljain 2 жыл бұрын
@@harharmahadev1038 What actually happens in selection sort is that we have to find minimum element and swap it with the first element of unsorted array, i.e. all smaller elements will come at beginning in ascending order. Now if "min" is not equal to "i" it means that beginning element of unsorted array and min element are different that is why we need to swap both of them. swap function is present in bits/stdc++ library, u can simply include the library and use the function instead of taking temp variable...
8.3.2 Bubble Sort | Sorting in C++ | Guaranteed Placement Course
6:46
8.3.3 Insertion Sort | Sorting Algorithms | C++ Placement Course |
9:37
Who Will Eat The Porridge First The Cockroach Or Me? 👧vs🪳
00:26
Giggle Jiggle
Рет қаралды 21 МЛН
Did you find it?! 🤔✨✍️ #funnyart
00:11
Artistomg
Рет қаралды 116 МЛН
I Need Your Help..
00:33
Stokes Twins
Рет қаралды 14 МЛН
Chips evolution !! 😔😔
00:23
Tibo InShape
Рет қаралды 32 МЛН
Selection Sort | C++ Example
9:49
Portfolio Courses
Рет қаралды 22 М.
9.1 Two Dimensional Arrays | 2D Arrays | C++ Placement Course
21:24
Apna College
Рет қаралды 524 М.
Should you study abroad in 2024? Is it worth it for Indian students?
18:45
8.1 Introduction to Arrays in C++ | Guaranteed Placement Course
12:32
Bubble Sort Code in Java | DSA
8:14
Telusko
Рет қаралды 26 М.
3 Signs of an Inexperienced Programmer | Avoid these in Tech
9:02
Apna College
Рет қаралды 349 М.
7.3 Bubble Sort Algorithm| Data Structures Tutorials
35:36
Jenny's Lectures CS IT
Рет қаралды 1,4 МЛН
Who Will Eat The Porridge First The Cockroach Or Me? 👧vs🪳
00:26
Giggle Jiggle
Рет қаралды 21 МЛН