8.3.2 Bubble Sort | Sorting in C++ | Guaranteed Placement Course

  Рет қаралды 807,403

Apna College

Apna College

3 жыл бұрын

Same notes as Lecture 9.3.1

Пікірлер: 524
@proteanguy3411
@proteanguy3411 3 жыл бұрын
Trust me she's gonna best instructor , teacher and mentor 🙏🔥💖
@Pratyush_Srivastava24
@Pratyush_Srivastava24 3 жыл бұрын
Her voice 💘
@Patternninjacrypto
@Patternninjacrypto 3 жыл бұрын
literally i was impressed by her first few videos and then searched her on youtube but sadly didn't found anything related to her. i wish she would also have channel so we can subscribe her and support her. 😊
@arpitchugh7297
@arpitchugh7297 3 жыл бұрын
The one who wrote the script might be crying in the corner 😂
@achabacha3809
@achabacha3809 3 жыл бұрын
She is best but don't leave Mysirg samjhe bachye😁😁😁😁
@mujtabahussain7015
@mujtabahussain7015 3 жыл бұрын
one of the*
@RahulSharma-cy1oz
@RahulSharma-cy1oz 3 жыл бұрын
Bubble sort - Time complexity is O(n^2) , and in best case it is O(n), if the array is already sorted. Thank you.
@amans6504
@amans6504 Жыл бұрын
If the array is already sorted, why would you sort? It would be just an iteration over the array so yeah order of n is obv
@l4dybu9
@l4dybu9 Жыл бұрын
Big O notation is for worst case. Hence O(n^2). For best case, it's big Omega notation Hence Ω(n).
@aryansharma-wf8sn
@aryansharma-wf8sn 3 жыл бұрын
Urvi didi teaches soooooo well she is the best 🥰🥰
@shreyaschavhan5522
@shreyaschavhan5522 3 жыл бұрын
Notes - Bubble Sort - Concept - [0:10] Bubble Sort - Code - [4:40]
@shubhsYT
@shubhsYT 2 жыл бұрын
pdhai krle bhai
@shreyaschavhan5522
@shreyaschavhan5522 2 жыл бұрын
@@shubhsYT 🙏
@subhanjanbasu4642
@subhanjanbasu4642 2 жыл бұрын
@@shreyaschavhan5522 thanks bhai
@chinmaymishra9814
@chinmaymishra9814 2 жыл бұрын
really felt gratitude didi, thank you for providing such a video for free. It contains the whole 2hrs of class lecture content incorporated in just few minutes, AMAZING.
@ujjwalverma2870
@ujjwalverma2870 2 жыл бұрын
In this video the counter should be intialise to 0 not 1 And in the for loop I
@jatingarg1897
@jatingarg1897 3 жыл бұрын
Thank you so much. You made these concepts so easy for me that looked difficult previously for me. Now, I taught these to my fellow classmates even before they knew.
@sevenhours1137
@sevenhours1137 2 жыл бұрын
best explanation on this topic, the visuals were extraordinarily effective
@sudarshanmhaisdhune1039
@sudarshanmhaisdhune1039 2 жыл бұрын
Wow!.....short, crisp and to-the-point..
@hrutiksherekar6516
@hrutiksherekar6516 3 жыл бұрын
Ma'am your voice is so listenable. Great explanation. Thank u so much
@fahadabdullah510
@fahadabdullah510 Жыл бұрын
You can also do this simply with the help of a for loop like this for (int i = 0; i < n - 1; i++) { for (int j = 0; j < n - i; j++) { if (arr[j + 1] < arr[j]) { temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; } } }
@harshagarwal920
@harshagarwal920 Жыл бұрын
you can also take initial value of i=1;for faster code
@aegg792
@aegg792 Жыл бұрын
the inner loop would be: for(int j = 0; j < n - i - 1; j++) you may cross-check to see 😊
@muktagavli1106
@muktagavli1106 2 жыл бұрын
Oh my God I was so worried about Data structure Then i saw your Video It is very Useful Keep up the good work
@shivammaurya3451
@shivammaurya3451 3 жыл бұрын
Thank u aman bhaiya and mam best explanation ever watched 😍🖤❤❤❤
@ajaykiran6
@ajaykiran6 3 жыл бұрын
Thanks a lot, ye bubble sort confuse kar diya tha teachers ne....ab jaake iska concept dhang se samajh aaya hai, final year mai hu abhi ......this series gives me hope that even I can learn these concepts properly.
@nayansinghal5157
@nayansinghal5157 2 жыл бұрын
Didi from this video i just watched the concept behind bubble sort and the code i printed on my own. The output was correct and I am very happy as I am a beginner and have printed the code very easily. Thx for your lectures.
@prajnagupta1287
@prajnagupta1287 3 жыл бұрын
This is awesome! Very concise and informative😍
@surbhikumari8443
@surbhikumari8443 3 жыл бұрын
Awesome mam after trying to visualise continue 8 hr then i come to video and in shot i got it all points thanku mam
@LifewRoshu
@LifewRoshu 2 жыл бұрын
Thank you so much AMAN BHAIYA and the whole team of APNA COLLEGE ❤️❤️✨✨
@asiyaprincess6913
@asiyaprincess6913 Жыл бұрын
Nice explained and easy to understand ☺️ Thank you so much mam👍
@shivammaurya3451
@shivammaurya3451 3 жыл бұрын
Thank u aman bhaia mam i m loving your explanation ❤ 😍
@ahmadshoaibmuslim8470
@ahmadshoaibmuslim8470 2 жыл бұрын
The great teaching method, Thanks for serving us these videos, and I have a suggestion please make basic projects and shout them as lessons. thank you so much for this kind of teaching,
@sageinwoods8859
@sageinwoods8859 2 жыл бұрын
ek to awaaz itni pyaari hai upar se padhati bhi world class hain
@ritu5368
@ritu5368 3 жыл бұрын
Amazing! Amazing! Amazing! 🔥🔥🔥🔥🔥💥💥💥
@parth8746
@parth8746 3 жыл бұрын
Awesome explaining in just 7 min.
@harshithp3007
@harshithp3007 3 жыл бұрын
I was able to code the bubble sort algorithm just by the explanation part of this video. Thank you very much !!
@veeresh4441
@veeresh4441 3 жыл бұрын
Mention complexity for each algorithm at the end of algorithm
@Pritamdaspk
@Pritamdaspk 3 жыл бұрын
O(n²) sabka yahi hoga
@GoD_AbHI.
@GoD_AbHI. 7 ай бұрын
Best Explanation I ever had.😊
@puneetmaheshwari
@puneetmaheshwari 3 жыл бұрын
imma using this explanation for python class 12 thankyou di and bhaiya
@omkakade4036
@omkakade4036 2 жыл бұрын
Thank you clear all doubts
@hruthikakani9274
@hruthikakani9274 3 жыл бұрын
I'm of class 11th following your every video .......from Andhra pradesh
@harshmalviya4831
@harshmalviya4831 3 жыл бұрын
[CORRECTION] In the while statement of the program, (counter
@juffler463
@juffler463 3 жыл бұрын
Yup you are right my brother but no matter if it takes one more iteration because array is already sorted. Yes it will take little more time. And this is not a good practice to make this mistake because you know this that it will take only "n-1" iteration to sort the array Hope you got your answer 👍👍👍😀😀😃
@joetonyaashish7985
@joetonyaashish7985 3 жыл бұрын
no bro. there is no mistake as counter is starting from 1 and not from 0. Otherwise you would be correct. since it is starting from 1, loop repeats (n-1) times only.
@vipulbhardwaj8659
@vipulbhardwaj8659 3 жыл бұрын
I need help plz! As we know there are (n-1) iterations So why we take (counter
@meme-qw6hl
@meme-qw6hl 3 жыл бұрын
@@vipulbhardwaj8659 it is for u Instade of using *whileloop* and *counter* u can use this for(int j=0;j
@meme-qw6hl
@meme-qw6hl 3 жыл бұрын
Instade of using *whileloop* and *counter* u can use this for(int j=0;j
@RahmanKhan-dw6sz
@RahmanKhan-dw6sz 3 жыл бұрын
thank you very much yrr it really helps ......and the music is also motivating....
@Rishabh_Dayal4444
@Rishabh_Dayal4444 3 жыл бұрын
sir really thanx a lot you all are doing nice job
@madhusingh4607
@madhusingh4607 3 жыл бұрын
Bilkul Sare doubts clear ho gaye mere..
@upamadutta5741
@upamadutta5741 3 жыл бұрын
beach mai ak din ka gaap ho gya tha,yesterday their was no new video, or meri to tention start hone laga tha, and that's why egarly waiting for todays video.
@AnkitGupta-pr4rg
@AnkitGupta-pr4rg 3 жыл бұрын
Mai commerce student hu phir v i feel the same 😑
@ashutoshgoyal3461
@ashutoshgoyal3461 3 жыл бұрын
same here
@ashishsingh4437
@ashishsingh4437 2 жыл бұрын
thank you for this awesome course
@rita_martha
@rita_martha Жыл бұрын
I recommend this video. I am very happy and grateful.
@vatsalkhatri514
@vatsalkhatri514 3 жыл бұрын
This can be minimised by putting a boolean for checking whether there are swaps or not. If there are no swaps then it proves that the array is already sorted no need to go ahead and hence breaking the loop.
@saipadmajakuncham
@saipadmajakuncham 11 күн бұрын
can you share that code
@abhishekkholiya6989
@abhishekkholiya6989 2 жыл бұрын
Bubble sort complexity - Time complexity - 1. Best case - O(n) ( if array is already sorted ) 2. Average case - O(n^2) 3. Worst case - O(n^2) Space complexity - O(the number of extra variables used) if 1 extra variable then O(1) , if 2 extra variable then O(2).
@developerakhter______0076
@developerakhter______0076 Жыл бұрын
BEST Bubble Sort VDO ever...❤
@mdfoysalahmed4612
@mdfoysalahmed4612 Жыл бұрын
Thanks for this amazing tutorial
@daksheshrajal2975
@daksheshrajal2975 3 жыл бұрын
Aman bhaiya is doing good for all of us and we should be thankful to him This channel deserves 1 million subscriber.
@adityaparmar1897
@adityaparmar1897 3 жыл бұрын
Thanks sir for this series , this help me more for my placement preparation
@negasonicteenagewarhead
@negasonicteenagewarhead 3 жыл бұрын
@@SahilSharma-vl9rk bro it's less than n
@prmomaths757
@prmomaths757 3 жыл бұрын
@@negasonicteenagewarhead what do you mean?
@rajlaxmipaul21
@rajlaxmipaul21 3 жыл бұрын
@@negasonicteenagewarhead you have n o t said anything exactly "in a clear way". soou.. wht's da point of commenting “
@negasonicteenagewarhead
@negasonicteenagewarhead 3 жыл бұрын
@@rajlaxmipaul21 The person I replied to has deleted his comment
@rajlaxmipaul21
@rajlaxmipaul21 3 жыл бұрын
@@negasonicteenagewarhead oou i didn't understand dat
@iamgroot20
@iamgroot20 3 жыл бұрын
superb explanation👌👌
@rutvikrana512
@rutvikrana512 3 жыл бұрын
We don’t need to run n times this algorithm If we don’t find any swapping. It’s like break when no bubbles happens. As per video... Current Time complexity : O(N*N) But it can give O(N) in best case eg. already sorted array. Just check by boolean that if no bubble produce ( no swapping occurs ) break loop. 👌
@snehilsinha4689
@snehilsinha4689 3 жыл бұрын
I agree with you that it will give O(n) time complexity in best case. But that's not our concern. We have to find some algorithm so that the worst case time complexity gets minimized ,which according to me, can't be lesser than O(n^2) in the bubble sort method. If there's a way to decrease the worst case complexity here please share. 🙏
@novaprime8735
@novaprime8735 3 жыл бұрын
Great.....
@svworld01
@svworld01 3 жыл бұрын
You are right bro, this is updated bubble sort that you are talking about. 👍👍
@anakingaming3687
@anakingaming3687 3 жыл бұрын
Aap sab log kaafi padhe likhe lag rahe ho, aap logo ki job lag gayi h kya yeh videos dekhne k baad ?
@svworld01
@svworld01 3 жыл бұрын
@@anakingaming3687 pahle hi lag chuki hai job bhai.. Pr aise q bol rhe ho?
@lalitshah7867
@lalitshah7867 3 жыл бұрын
Didi bahut achha hai thanks
@DevendraChoudhary888
@DevendraChoudhary888 3 жыл бұрын
Nice work by didi and aman bhaiya
@ekansh6267
@ekansh6267 Жыл бұрын
Awesome explanation 👌👍
@friendgaming4651
@friendgaming4651 3 жыл бұрын
Wow🤟🔥🔥🔥.. Excellent
@vedantparatkar7266
@vedantparatkar7266 3 жыл бұрын
YOU ARE doing very good job ,best teacher!!
@DrManju_1
@DrManju_1 3 жыл бұрын
Name was corrected, but *also correct the description box from 9.3.1 to 8.3.1 !* This is Aman Bhaiya, 😉 No Chance of Mistakes. Even when once there was a error in animation in Maths, he corrected it in the comments !!!
@yogeshvats1999
@yogeshvats1999 3 жыл бұрын
Very easy to understand it now rather than boring lecture in class
@prashantdhami4863
@prashantdhami4863 3 жыл бұрын
dislikers are Chintu's ghar vaale who paid 100k plus rs to white hate 😂
@coderx1871
@coderx1871 7 ай бұрын
Very well explained Shradha didi
@jaimodkumar5282
@jaimodkumar5282 2 жыл бұрын
It's very fast and effective method to solve bubble sort as how to works and implement in program
@rajivkumawat7940
@rajivkumawat7940 2 жыл бұрын
nice explaination mam.....
@__lyricsSmooth
@__lyricsSmooth 4 ай бұрын
Best way for learning apna college by shraddha didi❤
@MrKB_SSJ2
@MrKB_SSJ2 Жыл бұрын
This was really helpful. Thanks
@ShivamGupta-cx3hy
@ShivamGupta-cx3hy 3 жыл бұрын
Thank you so much ❤️😊
@anabildebnath2590
@anabildebnath2590 20 күн бұрын
Simple and precise
@gopalmasulkar8915
@gopalmasulkar8915 2 жыл бұрын
Dear sister your awesome I like your teaching 🥰
@ShubhamSaraf30
@ShubhamSaraf30 3 жыл бұрын
Counter < n hoga in while condition. I think. Ma'am ke code mei bhi -1 type nahi hua (maybe due to some error)
@ultimatecreed5144
@ultimatecreed5144 3 жыл бұрын
yes n-1 nahi n yoga
@namanjain0412
@namanjain0412 3 жыл бұрын
Awesome course🤞🤞🤞🤞
@fahadmughal9795
@fahadmughal9795 Жыл бұрын
in while loop counter is not less than n-1 its while( counter < n )
@ByteBit4k
@ByteBit4k 4 ай бұрын
either it is
@AkashVerma-sh5pb
@AkashVerma-sh5pb 2 жыл бұрын
instead of the while loop we can also do this : for(i=count-2;i>=0;i--){ for(j=0;jnumber[j+1]){ temp=number[j]; number[j]=number[j+1]; number[j+1]=temp;
@user-yx3xu6ih8j
@user-yx3xu6ih8j 10 ай бұрын
very informative good video💓
@singhrocco
@singhrocco 3 жыл бұрын
5:25 didi ham ek swap() function ka bhi to use kar sakte hai bas swap(arr[i], arr[i+1]); ek line me ho jata 3 lines ke jagah
@ashwinpillai9291
@ashwinpillai9291 3 жыл бұрын
nah ...then u would have to create the whole funtion for swap() seperately >....thus same amount of work...Use funtion only when u need to repeatedly use it
@harshkantbhatnagar360
@harshkantbhatnagar360 3 жыл бұрын
​@@ashwinpillai9291 no in the bits/stdc++.h header file it's already present we can use that in place of iostream
@namitgarg3364
@namitgarg3364 3 жыл бұрын
@@harshkantbhatnagar360 We can also use this function using iostream header file see this code #include using namespace std; int main(){ int a,b; cin>>a>>b; cout
@harshkantbhatnagar360
@harshkantbhatnagar360 3 жыл бұрын
@@namitgarg3364 okay bro
@namitgarg3364
@namitgarg3364 3 жыл бұрын
@@harshkantbhatnagar360 No problem bro
@harshvardhan6213
@harshvardhan6213 3 жыл бұрын
Consistency = Aman Bhaiya And we all of us also be in a consistent manner always💥🙋🏻‍♂️
@vrushaliagate5250
@vrushaliagate5250 2 жыл бұрын
Amazing🔥🔥🔥🔥🔥❤️❤️
@omraja404
@omraja404 2 ай бұрын
Thankyou ma'am
@alangeorge1090
@alangeorge1090 3 жыл бұрын
Really well explained
@sonudeep6472
@sonudeep6472 3 жыл бұрын
Great tutorial👨‍🏫📓
@huzaifasaqib8138
@huzaifasaqib8138 7 ай бұрын
Thanks!
@hardikverma8249
@hardikverma8249 2 жыл бұрын
Thanks a lot I got it 🥳
@jaimodkumar5282
@jaimodkumar5282 2 жыл бұрын
Thanks so much
@himanshuprem600
@himanshuprem600 3 жыл бұрын
thank you.......
@MRMAC-hh9op
@MRMAC-hh9op 2 жыл бұрын
Thanks didi and bhaiya
@AkibHussain
@AkibHussain 3 жыл бұрын
Op🔥📌
@user-ng7eg9nq7f
@user-ng7eg9nq7f 2 жыл бұрын
before apna college ,i was dumb in coding,concept of coding went to upper side from my head,One day i meet to my brother,He suggested me to see coding on apna college,,and then after this,, now I can say that i can do something in coding.Love U all apna college team,,One day I shall meet to apna college team sure,specially Shradhha di.
@Saini2448
@Saini2448 4 ай бұрын
Thank you mam 🤗
@angrybird707
@angrybird707 3 жыл бұрын
i loveeee ur HAIN NA!!! :)
@AkibHussain
@AkibHussain 3 жыл бұрын
Thank you
@vaishnavighate8068
@vaishnavighate8068 3 жыл бұрын
It took my clg sooo many hours to explain this and still kuch samjh nhi aaya.. But thanku didi and aman bhaiya for such amazing content.. Thankyou❤❤
@sanketsingh5555
@sanketsingh5555 2 жыл бұрын
Thnx buddy ❤️
@NitinSihag
@NitinSihag 3 жыл бұрын
Keep it up bhaiya💟💟
@krishsharma6276
@krishsharma6276 3 жыл бұрын
Thanks ☺️
@NishantSingh-br6iu
@NishantSingh-br6iu 3 жыл бұрын
East or West Urvi Di is the best
@user-zw1xp7it3o
@user-zw1xp7it3o 3 жыл бұрын
how did you get to know her name ?
@harshraj-yz3pf
@harshraj-yz3pf 2 жыл бұрын
Wo jab Apne code ko run Karti hai ...toh waha pe unka Naam show hota hai
@meharsingh3091
@meharsingh3091 2 жыл бұрын
Her name is shardha
@VikramKumar-qw5cz
@VikramKumar-qw5cz 3 жыл бұрын
Nice lecture..
@Exploring_With_Sourav
@Exploring_With_Sourav 3 жыл бұрын
thanks for making
@MohitSingh0798
@MohitSingh0798 3 жыл бұрын
Best video
@sniffers4778
@sniffers4778 Жыл бұрын
I love the 15 chocolate example
@prabhdeepsingh5222
@prabhdeepsingh5222 3 жыл бұрын
love u guys
@shaleenbadola4514
@shaleenbadola4514 3 жыл бұрын
well its (counter
@gauravjain1444
@gauravjain1444 3 жыл бұрын
It is not just because we will have to do one less iteration , in the code we are comparing the (i th) and (i+1 th) terms. So we keep the counter < n-1 so that when we are checking for the (i+1 th) term we do not get *INDEX OUT OF BOUND ERROR*
@shaleenbadola4514
@shaleenbadola4514 3 жыл бұрын
@@gauravjain1444 ya i know that but it should be counter
@gauravjain1444
@gauravjain1444 3 жыл бұрын
@@shaleenbadola4514 counter
@shaleenbadola4514
@shaleenbadola4514 3 жыл бұрын
@@gauravjain1444 i agree with counter not should be initialized with 0 but in video di said counter
@gauravjain1444
@gauravjain1444 3 жыл бұрын
@@shaleenbadola4514 see the video once again they edited the -1 part out 😅 .she says n-1 but in the code she writes n
@saumyasinghchauhan275
@saumyasinghchauhan275 3 жыл бұрын
Thank uh
@shettycodes
@shettycodes 2 жыл бұрын
Thank you for explaning bubble sort in concise way easily🙂
@krishangupta7055
@krishangupta7055 3 жыл бұрын
well i prefer this code. //Sorting is done here for(int i=0; i
@ADEEBARASHIDBAI
@ADEEBARASHIDBAI 2 жыл бұрын
thank you so much
@HeaDHunteR-xu7we
@HeaDHunteR-xu7we 3 жыл бұрын
Bhaiya , please make a video on IP university order of choice filling 🙏🙏
@abhaytiwari6411
@abhaytiwari6411 3 жыл бұрын
WellDone Guru
@javeriasaleem3154
@javeriasaleem3154 Жыл бұрын
great
@mamonipodder5613
@mamonipodder5613 Жыл бұрын
I'm very dumb in computer science but the way she explained really helped me
8.3.3 Insertion Sort | Sorting Algorithms | C++ Placement Course |
9:37
Bubble Sort | C++ Example
13:20
Portfolio Courses
Рет қаралды 22 М.
터키아이스크림🇹🇷🍦Turkish ice cream #funny #shorts
00:26
Byungari 병아리언니
Рет қаралды 24 МЛН
Climbing to 18M Subscribers 🎉
00:32
Matt Larose
Рет қаралды 34 МЛН
IS THIS REAL FOOD OR NOT?🤔 PIKACHU AND SONIC CONFUSE THE CAT! 😺🍫
00:41
8.3.1 Sorting in Arrays | Selection Sort |  C++ Placement Course
8:32
Apna College
Рет қаралды 1 МЛН
Merge Sort | Code and Explanation | C++ Course - 19.1
17:10
Apna College
Рет қаралды 447 М.
Bubble Sort  | Logical Programming in C | Naresh IT
11:10
Naresh i Technologies
Рет қаралды 478 М.
7.3 Bubble Sort Algorithm| Data Structures Tutorials
35:36
Jenny's Lectures CS IT
Рет қаралды 1,4 МЛН
Object-Oriented Programming is Embarrassing: 4 Short Examples
28:03
3 Signs of an Inexperienced Programmer | Avoid these in Tech
9:02
Apna College
Рет қаралды 391 М.
11. Pointers in C++ | Guaranteed Placement Course
19:03
Apna College
Рет қаралды 618 М.
Learn Hash Tables in 13 minutes #️⃣
13:26
Bro Code
Рет қаралды 320 М.
터키아이스크림🇹🇷🍦Turkish ice cream #funny #shorts
00:26
Byungari 병아리언니
Рет қаралды 24 МЛН