Bubble sort - Time complexity is O(n^2) , and in best case it is O(n), if the array is already sorted. Thank you.
@amans65042 жыл бұрын
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
@l4dybu92 жыл бұрын
Big O notation is for worst case. Hence O(n^2). For best case, it's big Omega notation Hence Ω(n).
@chinmaymishra98143 жыл бұрын
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.
@proteanguy34114 жыл бұрын
Trust me she's gonna best instructor , teacher and mentor 🙏🔥💖
@Pratyush_Srivastava244 жыл бұрын
Her voice 💘
@Harshp0624 жыл бұрын
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. 😊
@arpitchugh72974 жыл бұрын
The one who wrote the script might be crying in the corner 😂
@achabacha38093 жыл бұрын
She is best but don't leave Mysirg samjhe bachye😁😁😁😁
@mujtabahussain70153 жыл бұрын
one of the*
@aryansharma-wf8sn4 жыл бұрын
Urvi didi teaches soooooo well she is the best 🥰🥰
@daksheshrajal29754 жыл бұрын
Aman bhaiya is doing good for all of us and we should be thankful to him This channel deserves 1 million subscriber.
@nayansinghal233 жыл бұрын
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.
@शिवांकठाकुर-स8ल3 жыл бұрын
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.
@hrutiksherekar65164 жыл бұрын
Ma'am your voice is so listenable. Great explanation. Thank u so much
@muktagavli11063 жыл бұрын
Oh my God I was so worried about Data structure Then i saw your Video It is very Useful Keep up the good work
@ujjwalverma28703 жыл бұрын
In this video the counter should be intialise to 0 not 1 And in the for loop I
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.
@anshulpatidar59902 жыл бұрын
In while loop, its while(counter
@CodeWithPabo3 ай бұрын
yes you are right
@abhishekkholiya69892 жыл бұрын
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).
@adityaparmar18974 жыл бұрын
Thanks sir for this series , this help me more for my placement preparation
@negasonicteenagewarhead4 жыл бұрын
@@SahilSharma-vl9rk bro it's less than n
@prmomaths7574 жыл бұрын
@@negasonicteenagewarhead what do you mean?
@rajlaxmipaul214 жыл бұрын
@@negasonicteenagewarhead you have n o t said anything exactly "in a clear way". soou.. wht's da point of commenting “
@negasonicteenagewarhead4 жыл бұрын
@@rajlaxmipaul21 The person I replied to has deleted his comment
@rajlaxmipaul214 жыл бұрын
@@negasonicteenagewarhead oou i didn't understand dat
@surbhikumari84434 жыл бұрын
Awesome mam after trying to visualise continue 8 hr then i come to video and in shot i got it all points thanku mam
@harshithp30073 жыл бұрын
I was able to code the bubble sort algorithm just by the explanation part of this video. Thank you very much !!
@Guptaaryan14112 жыл бұрын
In case, if you are stuck Use this: int counter=0; while(counter
@khalidmustafa7102 Жыл бұрын
Isme h na 100 0 2 29 le rha hun to 2 0 29 100 output de rha h
@upamadutta57414 жыл бұрын
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-pr4rg4 жыл бұрын
Mai commerce student hu phir v i feel the same 😑
@ashutoshgoyal34614 жыл бұрын
same here
@Spot-Music_0111 ай бұрын
Best way for learning apna college by shraddha didi❤
@hruthikakani92744 жыл бұрын
I'm of class 11th following your every video .......from Andhra pradesh
@veeresh44414 жыл бұрын
Mention complexity for each algorithm at the end of algorithm
@Pritamdaspk3 жыл бұрын
O(n²) sabka yahi hoga
@yogeshvats19994 жыл бұрын
Very easy to understand it now rather than boring lecture in class
@rutvikrana5124 жыл бұрын
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. 👌
@snehilsinha46894 жыл бұрын
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. 🙏
@novaprime87354 жыл бұрын
Great.....
@svworld014 жыл бұрын
You are right bro, this is updated bubble sort that you are talking about. 👍👍
@anakingaming36874 жыл бұрын
Aap sab log kaafi padhe likhe lag rahe ho, aap logo ki job lag gayi h kya yeh videos dekhne k baad ?
@svworld014 жыл бұрын
@@anakingaming3687 pahle hi lag chuki hai job bhai.. Pr aise q bol rhe ho?
@harshvardhan62134 жыл бұрын
Consistency = Aman Bhaiya And we all of us also be in a consistent manner always💥🙋🏻♂️
@jatingarg18974 жыл бұрын
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.
@madhusingh46074 жыл бұрын
Bilkul Sare doubts clear ho gaye mere..
@shivammaurya34514 жыл бұрын
Thank u aman bhaiya and mam best explanation ever watched 😍🖤❤❤❤
@LifewRoshu3 жыл бұрын
Thank you so much AMAN BHAIYA and the whole team of APNA COLLEGE ❤️❤️✨✨
@fahadmughal9795 Жыл бұрын
in while loop counter is not less than n-1 its while( counter < n )
@ByteBit4k11 ай бұрын
either it is
@vaishnavighate80684 жыл бұрын
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❤❤
@cyber_nerd58444 жыл бұрын
A tiny mistake at 4:59 where u said counter
@meme-qw6hl3 жыл бұрын
Instade of using *whileloop* and *counter* u can use this for(int j=0;j
@AkashVerma-sh5pb3 жыл бұрын
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;
@ahmadshoaibmuslim84702 жыл бұрын
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,
@DrManju_14 жыл бұрын
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 !!!
@ShubhamSaraf304 жыл бұрын
Counter < n hoga in while condition. I think. Ma'am ke code mei bhi -1 type nahi hua (maybe due to some error)
@ultimatecreed51443 жыл бұрын
yes n-1 nahi n yoga
@jaimodkumar52823 жыл бұрын
It's very fast and effective method to solve bubble sort as how to works and implement in program
@shaleenbadola45144 жыл бұрын
well its (counter
@gauravjain14444 жыл бұрын
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*
@shaleenbadola45144 жыл бұрын
@@gauravjain1444 ya i know that but it should be counter
@gauravjain14444 жыл бұрын
@@shaleenbadola4514 counter
@shaleenbadola45144 жыл бұрын
@@gauravjain1444 i agree with counter not should be initialized with 0 but in video di said counter
@gauravjain14444 жыл бұрын
@@shaleenbadola4514 see the video once again they edited the -1 part out 😅 .she says n-1 but in the code she writes n
@mamonipodder5613 Жыл бұрын
I'm very dumb in computer science but the way she explained really helped me
@developerakhter______00762 жыл бұрын
BEST Bubble Sort VDO ever...❤
@divyamharbola68763 жыл бұрын
Everyone do like man, They are providing Platinum for free.
@sudarshanmhaisdhune10393 жыл бұрын
Wow!.....short, crisp and to-the-point..
@marketing_with_nosh7 күн бұрын
Best class ❤❤
@puneetmaheshwari4 жыл бұрын
imma using this explanation for python class 12 thankyou di and bhaiya
@DevendraChoudhary8884 жыл бұрын
Nice work by didi and aman bhaiya
@sevenhours11373 жыл бұрын
best explanation on this topic, the visuals were extraordinarily effective
@shivammaurya34514 жыл бұрын
Thank u aman bhaia mam i m loving your explanation ❤ 😍
@sumitbangra83593 жыл бұрын
Complete code ek saath dikh jata to shi rhta😊 baaki video jbrdsttt hai 👌👌💥💥💥
@fahadabdullah5102 жыл бұрын
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 Жыл бұрын
you can also take initial value of i=1;for faster code
@aegg792 Жыл бұрын
the inner loop would be: for(int j = 0; j < n - i - 1; j++) you may cross-check to see 😊
@gopalmasulkar89152 жыл бұрын
Dear sister your awesome I like your teaching 🥰
@krishangupta70553 жыл бұрын
well i prefer this code. //Sorting is done here for(int i=0; i
@ADEEBARASHIDBAI2 жыл бұрын
thank you so much
@rita_martha2 жыл бұрын
I recommend this video. I am very happy and grateful.
@nihal1774 жыл бұрын
Bhaiya apni kaksha mai pls thoda jaldi jaldi video daalo kyuki humare per board hai agle mahine se hum of wale hai bhaiya aur kv mai pre board pahele hota hai... Mujhe pata hai app bahut mahenat kar rahe ho aur animation mai time bhi lagta hai lekin fir bhi bhaiya thoda jaldi🙏🙏🙏
@sageinwoods88592 жыл бұрын
ek to awaaz itni pyaari hai upar se padhati bhi world class hain
@kv-ll2fn5 ай бұрын
i have done c++ the much it is needed for dsa. you explain the dry run thing very well but when it comes to code there are many things i am not understanding.
@NishantSingh-br6iu4 жыл бұрын
East or West Urvi Di is the best
@A7503-d4i4 жыл бұрын
how did you get to know her name ?
@harshraj-yz3pf2 жыл бұрын
Wo jab Apne code ko run Karti hai ...toh waha pe unka Naam show hota hai
@meharsingh30912 жыл бұрын
Her name is shardha
@jaydeep67573 жыл бұрын
*NOTE*- COUNTER MUST BE INITIALIZED WITH 0 INSTEAD OF 1, as she explains... But taken 1 mistakenly.... #CHLO PHODTE HYY ✨⚡😎
@coderx1871 Жыл бұрын
Very well explained Shradha didi
@harshmalviya48314 жыл бұрын
[CORRECTION] In the while statement of the program, (counter
@juffler4634 жыл бұрын
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 👍👍👍😀😀😃
@joetonyaashish79854 жыл бұрын
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.
@vipulbhardwaj86593 жыл бұрын
I need help plz! As we know there are (n-1) iterations So why we take (counter
@meme-qw6hl3 жыл бұрын
@@vipulbhardwaj8659 it is for u Instade of using *whileloop* and *counter* u can use this for(int j=0;j
@meme-qw6hl3 жыл бұрын
Instade of using *whileloop* and *counter* u can use this for(int j=0;j
@GoD_AbHI. Жыл бұрын
Best Explanation I ever had.😊
@lalitshah78674 жыл бұрын
Didi bahut achha hai thanks
@omkakade40363 жыл бұрын
Thank you clear all doubts
@singhrocco4 жыл бұрын
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
@ashwinpillai92914 жыл бұрын
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
@harshkantbhatnagar3604 жыл бұрын
@@ashwinpillai9291 no in the bits/stdc++.h header file it's already present we can use that in place of iostream
@namitgarg33643 жыл бұрын
@@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
@harshkantbhatnagar3603 жыл бұрын
@@namitgarg3364 okay bro
@namitgarg33643 жыл бұрын
@@harshkantbhatnagar360 No problem bro
@prajnagupta12873 жыл бұрын
This is awesome! Very concise and informative😍
@AnshikaSingh06003 ай бұрын
Very nicely explained 👍
@marudharkanwar20674 жыл бұрын
Everyone is a legend until aman bhaiya walks in😎😎😎
@HamadKhan-k5x2 ай бұрын
loved your unique method of teaching programming.....its becoming so easy for me 😍😍😍😍😍😍😍😍😍😍😍😍😄😄😄😄😄😄😄😄🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰
@examnotes-jee31844 жыл бұрын
What a short🔥🔥😍
@sniffers47782 жыл бұрын
I love the 15 chocolate example
@clonedaddy18243 жыл бұрын
There is a mistake in this code ,the last input no is not get check or swap. Int counter is starting form 1 and if the input is (54321 it will give 23451 ) it is not checking the last element. Plz check this . Y the counter is not staring from 0.
@vimabhardwaj82063 жыл бұрын
just want to notify that there is an error in notes ... in the for loop statement of bubble sort ...n-counter will be there instead of n-counter-1 :)
@atanmehdi66813 жыл бұрын
its correct , the code written in video is wrong.
@lakshyajoshi54133 жыл бұрын
the code in video and in notes both are correct look in the video counter=1 and in notes counter=0
@abhishekraibagi28693 жыл бұрын
@@lakshyajoshi5413 but code is not working it's showing exit with code status 0
@asiyaprincess69132 жыл бұрын
Nice explained and easy to understand ☺️ Thank you so much mam👍
@KhinHanDi-o8o Жыл бұрын
very informative good video💓
@uttamkarmakarece35343 жыл бұрын
I don't think anyone can explain the bubble concept so easily than how our Didi teaches us 😍❤️ *** The condition inside while loop should be counter
@sourabhsingh59413 жыл бұрын
no bro u are wrong if the condition inside while loop is counter < n-1 then it actually means n-2 because the relational operator is "
@novagames57193 жыл бұрын
@@sourabhsingh5941 he is correct bro my code won't run on that condition given in lecture
@prabhakarpatel6388 Жыл бұрын
in place of while loop , if we use for loop , have same time complexity , but space complexity may be improved.
@iamgroot204 жыл бұрын
superb explanation👌👌
@friendgaming46514 жыл бұрын
Wow🤟🔥🔥🔥.. Excellent
@prashantdhami48634 жыл бұрын
dislikers are Chintu's ghar vaale who paid 100k plus rs to white hate 😂
@parth87463 жыл бұрын
Awesome explaining in just 7 min.
@ekansh62672 жыл бұрын
Awesome explanation 👌👍
@vishalvarma83003 жыл бұрын
Hello team, Please try to mention complexity analysis for each necessary videos and if possible please inculde the puzzles similar to later videos Overall learning experience is too good and simple and best. Thank you.
@ritu53684 жыл бұрын
Amazing! Amazing! Amazing! 🔥🔥🔥🔥🔥💥💥💥
@vedantparatkar72664 жыл бұрын
YOU ARE doing very good job ,best teacher!!
@rajivkumawat79402 жыл бұрын
nice explaination mam.....
@RahmanKhan-dw6sz3 жыл бұрын
thank you very much yrr it really helps ......and the music is also motivating....
@namanjain04124 жыл бұрын
Awesome course🤞🤞🤞🤞
@tilakjilka64463 жыл бұрын
I think the whole algo is correct but instead of creating temp variable for swapping we can like use function swap( arr [ i+1], arr[i] ) this will reduce time and logic is simple too ! what say !
@oneseven14 жыл бұрын
Aman bhaiya...thoda aur sound increase kijiye...srif yehe video mein nahi aur bhi 2-4 aur video hai jismen sound level kamm hai
@minni97524 жыл бұрын
Amazing lecture 👍
@aditshah26624 жыл бұрын
@@SahilSharma-vl9rk editing mistake
@proteanguy34114 жыл бұрын
@@SahilSharma-vl9rk n-1 in index but for size it will be run
@aditshah26624 жыл бұрын
@@SahilSharma-vl9rk bhai mereko nahi pata hai i m a class 12th student..... i think it might be editing mistake
@novaprime87354 жыл бұрын
@@aditshah2662 bhai explanation me n-1 times tq loop chalane ki baat ki gai hai na ki n-1 index tq.... Kuch bhi galat nahi hai.....
@aditshah26624 жыл бұрын
@@novaprime8735 ok
@aishwarya18953 жыл бұрын
Time complexity:O(N^2)
@aniketjaiin4 жыл бұрын
By mistake you have put 9 instead of 8 in the title of the video...kindly correct it...It creates confusion...you are awesome...thanks for this series.🙂
@pranav_10564 жыл бұрын
Bhaiya just a reminder( I know you definately remeber) Please upload the notes of 8.2 video They aren't uploaded yet 🙏🙏
@Rishabh_Dayal44444 жыл бұрын
sir really thanx a lot you all are doing nice job
@shettycodes3 жыл бұрын
Thank you for explaning bubble sort in concise way easily🙂
@xoloera1x2542 жыл бұрын
di apne bola ki hume (n-1)iteration ke baad sorted array milega to is hissab se while loop (count
@educationalhub19043 жыл бұрын
DIDI your voice is so attractive and I like your intro as well as your content is fantastic more help to me preparation for placement
@HeaDHunteR-xu7we4 жыл бұрын
Bhaiya , please make a video on IP university order of choice filling 🙏🙏
@hisokamorrow79763 жыл бұрын
apart from using 'while + for' loop, one can also use double-for loops: for(int i=0;i
@mansha65663 жыл бұрын
i think j's loops should be from 0 to n - i - 1?
@hisokamorrow79763 жыл бұрын
@@mansha6566 I dont think so, for i=0 it's supposed to run till 5(4th index) and for i=1 till 5-1=4(3rd index)
@mansha65663 жыл бұрын
@@hisokamorrow7976 I don't think so, for i=0 ,j should run from 0 to 3 only ,on fourth iteration(for j=3) you will get largest element at the end of array ,plz check
@hisokamorrow79763 жыл бұрын
@@mansha6566 Ah! I got what you're saying thank you for correcting, I mistook this comment as the one on search video. Thanks
@mansha65663 жыл бұрын
@@hisokamorrow7976 ☺️🤘
@sharathk5684 жыл бұрын
Below is the bubble sort that i have done based on her explaination.....any comments on its time complexity. for(int i=0; i