Lecture 74: Heaps in C++ || Heap Sort || Insertion/Deletion in Heap || Priority Queue STL

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ม.ค. 2025

ความคิดเห็น •

  • @chiragyadav5467
    @chiragyadav5467 2 ปีที่แล้ว +185

    in deletion there should one condition should also mention arr[leftIndex]

    • @naveensingh4859
      @naveensingh4859 2 ปีที่แล้ว +3

      yepp,this code is right bro

    • @aadilkhan4867
      @aadilkhan4867 ปีที่แล้ว +2

      thanks a lot you too bhaiya

    • @PratikD-dy4yo
      @PratikD-dy4yo ปีที่แล้ว +1

      exactly.... !

    • @anshikajain3298
      @anshikajain3298 ปีที่แล้ว +12

      if you use if statements only instead of if and else if then you will get the correct answer

    • @ekanshsharma1309
      @ekanshsharma1309 ปีที่แล้ว

      Thank you buddy :)

  • @unboxtheuniverse5336
    @unboxtheuniverse5336 2 ปีที่แล้ว +176

    Hey bhagwan jii babbar bhaiya jesa dedication aur consistency dedo apne goal ke liye 👌🙏🔥

  • @rahulpanjwani8449
    @rahulpanjwani8449 ปีที่แล้ว +95

    I think there will be one more condition in deletion for checking that if left is also greater than right or if right is greater than left in else if.
    One more thing when we are checking the bound in that it should be less than equal to.
    The correct code for deletion will be
    void deletefromHeap()
    {
    if(size==0)
    {
    cout

    • @HridoyHasan-j5b
      @HridoyHasan-j5b ปีที่แล้ว

      leftIndex

    • @ruchikabihari9980
      @ruchikabihari9980 ปีที่แล้ว +2

      I do agree 👍👍

    • @deveshgupta2931
      @deveshgupta2931 ปีที่แล้ว

      Bcoz without equal sign we will miss the last child bcoz we have already decremented the size above in the code
      @@HridoyHasan-j5b

    • @deveshgupta2931
      @deveshgupta2931 ปีที่แล้ว +9

      One more correction when we are checking leftindex

    • @deepakbanga5166
      @deepakbanga5166 11 หลายเดือนก่อน

      Even this is not going to work in case of example :- 10 7 6 5 2

  • @anuragraut5101
    @anuragraut5101 2 ปีที่แล้ว +39

    attendance ++ aandd consistency ++,aur bahot mazha araha hai,completed 160 questions on leetcode since january 1

  • @garvitchaurasiya2041
    @garvitchaurasiya2041 2 ปีที่แล้ว +41

    I have started advanced dsa so many times from different sources and channels but this time the understanding is of next level thanks a lot bhaiya

  • @hardycollins8917
    @hardycollins8917 2 ปีที่แล้ว +2

    la jawab! simply magnificent! boht hi nazakat se ek jattil vishya ko suljhaya!

  • @ritiksharma-im6dx
    @ritiksharma-im6dx 2 ปีที่แล้ว +7

    I never enjoyed coding ...but after following your course ..now icoding becomes my habit .thanks a lot bhaia

  • @msabhinavchandra4174
    @msabhinavchandra4174 11 หลายเดือนก่อน +3

    29:16 it's better to keep leftIndex

    • @SreevalliB-zv7qy
      @SreevalliB-zv7qy 10 หลายเดือนก่อน

      yes, actually. I don't understand why he's isn't checking those cases. He wrote it wrong?

    • @avinashr6100
      @avinashr6100 2 หลายเดือนก่อน

      Exactly

  • @aishwaryaporwal2321
    @aishwaryaporwal2321 2 ปีที่แล้ว +34

    Eagerly waiting for this!!! Thank you so much Bhaiya for covering this topic ♥️💯💯

  • @yashshetty7326
    @yashshetty7326 2 ปีที่แล้ว +24

    I think there's a mistake in Heapify Algorithm, the right condition should be right

    • @AtulSharma-sr9wi
      @AtulSharma-sr9wi 2 ปีที่แล้ว +2

      index is start from 0 so given ans is correct.

    • @KKK-bn3ez
      @KKK-bn3ez ปีที่แล้ว

      yes. I just discovered it myself also. Glad to see someone also been practicing and finding errors also.

    • @PRITESHKRSRV
      @PRITESHKRSRV ปีที่แล้ว

      @@AtulSharma-sr9wi starting index is taken 1 from the beginning of the video, were u on weeds while taking the lecture ?

    • @PRITESHKRSRV
      @PRITESHKRSRV ปีที่แล้ว

      Thanks for pointing out bro

  • @vortexdeo4545
    @vortexdeo4545 2 ปีที่แล้ว +52

    25:02 Deletion logic me you swapped with whichever of the two children are greater.
    28:30 Code: compares with either left or, later, right. If left one is greater (even if not greater than right) then that case will run.
    Suppose tree was 52 53 54 50, then code would make it 53 52 54 50 and not 54 53 52 50.
    Koi baat nhi hume logic samajh aa gya👍

    • @Ranjankumar-ik4vf
      @Ranjankumar-ik4vf 2 ปีที่แล้ว +1

      Yes

    • @abhibitcodes
      @abhibitcodes 2 ปีที่แล้ว

      yes

    • @sudhanshusingh2579
      @sudhanshusingh2579 2 ปีที่แล้ว +3

      for the second one , dono me if statements use hue hai, so agar pehla wala true hota hai, to pehla wala largest hoga, uske baad wo dusre wale k saath pehla compare hoga because wo already largest ho chuka hai,

    • @MDAKMAL0786
      @MDAKMAL0786 ปีที่แล้ว +2

      *DELETION CORRECT CODE WITH EACH EDGE CASE
      void dlt ()
      {
      if ( size == -1 )
      {
      cout

    • @tusharvlogs6333
      @tusharvlogs6333 ปีที่แล้ว

      ye jo tree hai 52 53 54 50,, ---> ye kisi heap property ko follow hae nahi krrha nither minheap nor maxheap toh isko pehle ek heap property ka tree banao, scondly haan there is error in thr code for deletion. we need to compare leftchild and rightchild before saying who is the greatest of them

  • @ghauriaja3768
    @ghauriaja3768 2 ปีที่แล้ว

    Itna achy sy Heap ko sari youtube py kisi ny nahi samjhaya...You are great Sir. Thanks for this amazing series.

  • @krishnaradhey2814
    @krishnaradhey2814 2 ปีที่แล้ว +1

    Love you babbar bhai....... Ham Garibo ke liye IT MEANS ALOT

  • @janvisharma2377
    @janvisharma2377 9 หลายเดือนก่อน +2

    Best DSA playlist ever, thank you so much for helping us.😍😍❤❤

  • @aryansinha1818
    @aryansinha1818 ปีที่แล้ว +1

    Laal phool pila phool Love bhaiya beautiful. Jokes apart tbh I really think he is such a cool person. Amazing explanation. Easy to understand.

  • @ShivamKumar-hf5ec
    @ShivamKumar-hf5ec 2 ปีที่แล้ว +1

    29:00 deletion logic a little change
    just to check in left or right which one is greater
    void delHeapEle() {
    if(size == 0) {
    cout

  • @sumitmishra3514
    @sumitmishra3514 ปีที่แล้ว +6

    it feels good to continue watching the whole series and completed this many lectures thank you bhaiya for providing us this amazing series free of cost.

    • @vj270-o6v
      @vj270-o6v ปีที่แล้ว +1

      Are you able to solve leetcode questions?

  • @prashantbirajdar9271
    @prashantbirajdar9271 2 ปีที่แล้ว +1

    wahh bhiyaa mza aa gya ekdum jabardast...subkuch samaj aya mereko......thanks bhiya love u

  • @SupriyoGhosh-gz3fs
    @SupriyoGhosh-gz3fs 8 หลายเดือนก่อน +1

    You guys are the ones, for whom we cse students can survive.

  • @faizanhussain4471
    @faizanhussain4471 2 ปีที่แล้ว +90

    correction in the deletion method - compare the leftIndex and rightIndex, then swap the greater one if it is greater than parent.

    • @ankityadavIITian
      @ankityadavIITian 2 ปีที่แล้ว +1

      correct bro

    • @suratnu4609
      @suratnu4609 2 ปีที่แล้ว

      can u pls send me the correct code

    • @rajeevkumaryadav6948
      @rajeevkumaryadav6948 ปีที่แล้ว +3

      @@suratnu4609 void deleteFromHeap(){
      if(size==0){
      cout

    • @ashhariqbalshanu
      @ashhariqbalshanu ปีที่แล้ว +9

      @@rajeevkumaryadav6948
      // Simpler one
      void deleteh()
      {
      if (size == 0)
      {
      cout

    • @ShivkumarRajmane
      @ShivkumarRajmane 11 หลายเดือนก่อน

      @@ashhariqbalshanu thanks for help bro

  • @DilipKumar-dv7zd
    @DilipKumar-dv7zd หลายเดือนก่อน

    You men, nailed it, i have started and left multiple time DSA just because i i did not find the way i was looking to be taught but you men made it exactly what i was looking empowering to write code yourself just by the concept explanation, the barrier of language does not comes into picture once the concept is rock solid. Hats off.

  • @debajyatibanerjee5480
    @debajyatibanerjee5480 ปีที่แล้ว +91

    I think #LoveBabbar did a slight mistake while writing the deletion method. We should do some slight modification in that code...
    void deleteRoot(){
    if(size==0){
    cout

    • @saptarshimajumdar180
      @saptarshimajumdar180 ปีที่แล้ว +2

      i was also stuck at this

    • @AyushmanTiwari-u6o
      @AyushmanTiwari-u6o ปีที่แล้ว +3

      Thanks u r the saviour

    • @UwUDibboChowdhury
      @UwUDibboChowdhury ปีที่แล้ว +1

      thank you later . uwuw

    • @cheems08213
      @cheems08213 ปีที่แล้ว +17

      still wrong, in modification 1's if condition you are accessing arr[rightInd] without checking rightIndex

    • @sumitworld918
      @sumitworld918 ปีที่แล้ว +1

      Literally you save my time, thanks❤❤

  • @tribikramdhar2811
    @tribikramdhar2811 2 ปีที่แล้ว +3

    The best explanation of heaps out here in C++. Such great content !!!

  • @yogeshsharma24
    @yogeshsharma24 2 ปีที่แล้ว +2

    Welcome back bhaiya with great consistency

  • @ajaybabupatel1665
    @ajaybabupatel1665 2 ปีที่แล้ว +1

    while(codehelp==babbar){
    learning ++;
    cout

  • @amritranjan2802
    @amritranjan2802 ปีที่แล้ว +1

    you are the best teacher Bhaiya ,Really Your video is awesome

  • @fgh427
    @fgh427 2 ปีที่แล้ว

    I love you babbar bhaiyya... doing heap revision and still everything is crystal clear...

  • @kunal4710
    @kunal4710 2 ปีที่แล้ว +1

    THANKYOU SO MUCH BHAIYA FOR THE AWESOME VIDEOS,SAB SMZH AA GYA Attendance ++ and Consistency ++

  • @parthsharma5966
    @parthsharma5966 2 ปีที่แล้ว +2

    consistency again high hai bhaiya dono ki.........thanks.

  • @sanskargour6673
    @sanskargour6673 ปีที่แล้ว +2

    At 25:30 the deletion code may not work for other input values (like : 50,60,70,80,90,100).
    Another if condition is required to find the larger value between arr[leftIndex] and arr[rightIndex],
    for this use :
    void Delete(){
    if(size < 1){
    cout

  • @pramodshettiwar9732
    @pramodshettiwar9732 2 หลายเดือนก่อน

    amazing video bhayya
    Learnt:
    1.insertion
    2.deletion
    3.heapify or build heap
    4.sort heap
    5.using stl priority queue >>max heap and min heap ;

  • @mr_nobody0
    @mr_nobody0 หลายเดือนก่อน

    bhaiya aapka video dekh ke padhne ka bhi man karne lagta hai best ho aap bhaiya

  • @CSEStudent777
    @CSEStudent777 ปีที่แล้ว +1

    I never enjoyed coding ...but after following your course ..now icoding becomes my habit .thanks a lot bhaia #love babbar

  • @DPCODE72
    @DPCODE72 2 ปีที่แล้ว +1

    I don't have words to express about ur dedication & hardworking. Tusi great ho great babar bhaiya

  • @Aman-fz1ew
    @Aman-fz1ew ปีที่แล้ว

    tagda video ,
    everything explainded very clearly with clear logic and code .

  • @CNILOYBARUA
    @CNILOYBARUA ปีที่แล้ว

    Thanks brothers , Our bangladeshi Coders really depends on the guys like you

  • @threeidiots6954
    @threeidiots6954 ปีที่แล้ว

    Literally sometimes I feel u r god behind this face.... Thnkuu so much for all your teaching 🙏🙏🙏🙏

  • @pushpendrasharma1744
    @pushpendrasharma1744 ปีที่แล้ว

    I learned all topic from start this dsa course very help full beginner level to high level because small concet point to point understand by love babbar bhaiya so again thanks bhaiya for free course .
    this best explanation for heap topc in c++.

  • @naeembrohi1821
    @naeembrohi1821 2 ปีที่แล้ว +1

    the way you explain things is great because you cover all the details in your lecture.

  • @jamitkumar7251
    @jamitkumar7251 2 หลายเดือนก่อน

    best dsa course on yt, no comparison bro 🔥🔥

  • @HARRY-xz1hf
    @HARRY-xz1hf ปีที่แล้ว

    Babbar bhai thanks a lot. Mujhe kabhi nahi laga tha mai array k alawa kuch samajh bhi sakunga but after watching your videos I can't believe I have started solving Hard level DSA questions on leetcode. Thank you so much brother.

  • @ehtemamulhaque8713
    @ehtemamulhaque8713 2 ปีที่แล้ว +2

    present marked sir ,getting motivation from your consistency level, aag laga diye bhaiya aap..

  • @avishkarpatil5871
    @avishkarpatil5871 10 หลายเดือนก่อน

    45:02 // H/W - How function - buidHeap takes O(N) why not O(Log N) as it is n/2
    Lets Dive into code , as during each Iteration the , heapify function takes O(Log N) time , so when we call n/2 each element takes O(Log N) time till it reaches 1 as O(Log N) + O(Log N) + O(Log N) ------- 1
    which boils Time complexity as O(N) for buidHeap() Function
    Hope you got it

  • @codingaid2753
    @codingaid2753 2 ปีที่แล้ว +16

    In deletion , we are not firstly comparing left and right child to find which is max ,we are simply uisng if else, if left greater than a[i] , we are swaping a[i] with left and due to if else , we are not comparing a[i] with right child , so little confusion in deletion code

    • @businessburstx
      @businessburstx 2 ปีที่แล้ว +1

      yes its not right you run for other test case. use heapify function instead to put new root at right position'

    • @AjayYadav-um1oj
      @AjayYadav-um1oj 2 ปีที่แล้ว +5

      @@KazHachiOreki You are wrong bro there is problem in deletion : After deleting first element if parent is 30 leftchild 40 rightchild 50 and according to code we are swapping with leftchild then parent 40 leftchild 30 rightchild still 50 (here rightchild is greater than parent which is not a heap) so we have to take max of left and right child before swapping ;
      please clarify if i am wrong ;

    • @abhijithkannan850
      @abhijithkannan850 2 ปีที่แล้ว +1

      yes to my understanding the parent node should swap the largest value among left and right child. Thus a comparison b/w left and right child value is necessary

  • @narendramohanpathak4456
    @narendramohanpathak4456 10 หลายเดือนก่อน +4

    It seems there is an issue in the deletion function. It is only checking either the left or right child, whereas it should check both the left and right children, similar to how it's done in the heapify function.

  • @deepakpottavatri7613
    @deepakpottavatri7613 11 หลายเดือนก่อน

    28:32 there is small correction in the code that is
    if(leftIndex < size && arr[i] < arr[leftIndex] && arr[leftIndex] > arr[rightIndex]) in line 57
    The reason :
    we need to compare the left and right children before swapping that's why we added another conditional " arr[leftIndex] > arr[rightIndex]" and there is no need to add "arr[leftIndex] < arr[rightIndex]" in else if part.

  • @venkateshpk7822
    @venkateshpk7822 8 หลายเดือนก่อน +1

    your content and explanation just awesome bhaiya.
    Some guys just notice one mistake and keep barking abt that without knowing how much effort you put for one lecture

  • @Hidden..03
    @Hidden..03 2 ปีที่แล้ว +3

    Ek no. bhiya we dont want animation but the quality content.....my concept getting stronger day by day....i will watch more 2 videos of heap question and please upload hash in upcoming week so that i can study that topic.

  • @bhawargujral3574
    @bhawargujral3574 2 ปีที่แล้ว +7

    I can't thank you enough bhaiya for this amazing series.. this series is helping me a lot to polish my skills. You are a great teacher and blessing to us ⭐

  • @utkarshsingh1457
    @utkarshsingh1457 2 ปีที่แล้ว +2

    Maza aagya bhaiya... Thanks to this course... Ab contest me bhi questions solve ho rhe hai... 3 months pehle he coding seekhni start ki thi aapke saath... Thanks again !!!!!❤❤❤❤

  • @cyro_-ej6xm
    @cyro_-ej6xm 8 หลายเดือนก่อน

    thanks luv babbar 💛 couldnt find any better way to understand heaps than this , respect++

  • @vipulkumar947
    @vipulkumar947 2 ปีที่แล้ว

    Mja a gya ......such an elaborative and simple explanation

  • @sparshverma5995
    @sparshverma5995 2 ปีที่แล้ว

    The BEST explanation of heaps on the internet, Great video

  • @asifmondal7609
    @asifmondal7609 ปีที่แล้ว

    bhaiya... 1 saal baad is video dekhne aaya hoon.. kuki bhul gya hoon heapify function
    But ye wala look me aapko firse dekh ke maza aagya sachi bata rha hoon
    😅😍😍

  • @theraunak1466
    @theraunak1466 ปีที่แล้ว

    First time commenting best channel for dsa

  • @sanchitsharma8413
    @sanchitsharma8413 ปีที่แล้ว

    probably the best course for dsa in youtube thanks a lot bhaiya

  • @rakshitsindhwani8871
    @rakshitsindhwani8871 2 ปีที่แล้ว +1

    Right now I am watching your 74th lecture , Tq for this course Bhaiya 🤘

  • @rahuldewangan8235
    @rahuldewangan8235 ปีที่แล้ว

    00:03 Heaps in C++ and Heap Sort
    03:27 Understanding the structure and composition of a heap
    07:14 Heap property in C++
    09:27 Understanding insertion and deletion in a heap
    15:44 Understanding and implementing the Inverter function
    17:50 MS Word printing and setting pins
    22:17 Deletion in Heap
    24:20 Explanation of heap sorting and insertion/deletion in heap
    29:46 Lecture 74 discusses Heaps in C++ including Heap Sort, Insertion/Deletion in Heap, and Priority Queue STL.
    32:23 Understanding the concept of heaps in C++
    36:45 Explanation of shifting inside a heap and its significance
    38:44 Heaps in C++ and Heap Sort
    43:14 Explanation of the heap sort algorithm
    45:37 Heap Sort in C++
    50:11 Heap Sort is a sorting algorithm that utilizes a heap data structure.
    52:22 Heaps in C++
    57:23 Heaps in C++
    1:00:09 Understanding priority queues and heap sort in C++

  • @avishkarpatil5871
    @avishkarpatil5871 10 หลายเดือนก่อน +4

    Hey everyone, just wanted to point out a small mistake in the code demonstrated in the tutorial.
    In the heapify function, when checking the conditions for left and right children, it should be leftchild

  • @RohitRana-tz2lr
    @RohitRana-tz2lr 2 ปีที่แล้ว

    Mja hi aa gya bhaiya aap se heap topic pdke... Thanks, bhaiya for making such an amazing course

  • @nishanttrivedi8711
    @nishanttrivedi8711 ปีที่แล้ว

    really , i have watched almost all the available videos on heap but you explained everything about heap and in great way , thankyou for this effort

    • @amnashahzadi7608
      @amnashahzadi7608 ปีที่แล้ว

      is heap structure is created only using arrays ? no need to create nodes like in tree ?

  • @BeEternal3250
    @BeEternal3250 19 วันที่ผ่านมา

    Nice Explanation bhaiya Jii
    Thanks for this amazing explanation 🙏

  • @hardikshukla4508
    @hardikshukla4508 2 ปีที่แล้ว +1

    A like is not enough justify the efforts and quality of this video. Thanks.

  • @yuvrajsinghbhadoria
    @yuvrajsinghbhadoria ปีที่แล้ว +14

    //For those who are struggling with deletion code, this is the correct one
    //The problem is with the condition (index

    • @shivam.mandhotra
      @shivam.mandhotra ปีที่แล้ว

      great job bruh!

    • @jalebi8481
      @jalebi8481 ปีที่แล้ว +2

      if left==size then right==size+1, so arr[right] should not be compared with arr[left]

    • @saptarshimajumdar180
      @saptarshimajumdar180 ปีที่แล้ว

      still wrong

    • @animexworld6614
      @animexworld6614 ปีที่แล้ว

      it is wrong.

    • @ShivkumarRajmane
      @ShivkumarRajmane 11 หลายเดือนก่อน

      heap wala code bhi galat hai kya bhai ?

  • @AAnand-my1ql
    @AAnand-my1ql 2 ปีที่แล้ว +2

    Best video for understanding heaps. Thank you so much!

  • @ahmedsohail8923
    @ahmedsohail8923 ปีที่แล้ว

    One of the finest explanations. May God bless you.

  • @rishabhkesarwani9506
    @rishabhkesarwani9506 2 ปีที่แล้ว +1

    Great explanation and the best part is your approach towards the question, it really helped me, thanks a lot bhaiya.

  • @nishchaybhokare2858
    @nishchaybhokare2858 หลายเดือนก่อน +1

    your videos are really helpful... Thank you.

  • @shivanshuamitabh831
    @shivanshuamitabh831 2 ปีที่แล้ว +1

    Awesome Explanation sir ji.. No one has covered these advanced topics so bautifully.😇

  • @vanshsharma9453
    @vanshsharma9453 10 หลายเดือนก่อน +1

    Best DSA Teacher

  • @adarshtapariya4275
    @adarshtapariya4275 2 ปีที่แล้ว +1

    Thanks for explaining such typicall topic in such a easy way...🤩🤩

  • @divyanshgupta7780
    @divyanshgupta7780 2 ปีที่แล้ว

    Bhaiya aap boring ko bhi interesting bana dete ho, your teaching is very good

  • @nikhilnagar4891
    @nikhilnagar4891 4 หลายเดือนก่อน

    Thank sir kl lab me que solve hai or aaj aapse pura heap padh liya❤❤❤

  • @digvijayjadhav1452
    @digvijayjadhav1452 ปีที่แล้ว +1

    Best DSA course on youtube !!👍

  • @mittalsoni7099
    @mittalsoni7099 หลายเดือนก่อน

    "Scratch nah pd jaaye" was personal🥺really cute😻

  • @Its_._aayush
    @Its_._aayush ปีที่แล้ว

    The way you teach is unstoppable. you are amazing teacher💯💯❤‍🔥❤‍🔥❤‍🔥

  • @aarti263
    @aarti263 2 ปีที่แล้ว

    thank you for being so great with us, you have clarified the searching technique of parent, left and right node so easily.

  • @aaravkumar1308
    @aaravkumar1308 2 ปีที่แล้ว

    thanq thanq thanq bhaiyaa .. majja agya isme toh .. kamaal krte ho aap..

  • @muhammadsuleman8936
    @muhammadsuleman8936 ปีที่แล้ว +1

    Lecture was superb dear Thanks a lot for such amazing content!

  • @UnusualStories69
    @UnusualStories69 ปีที่แล้ว +1

    One of the Best lecture on Heap Topic .ThankYou Bhaiya 🙂

  • @rishibhardwaj4489
    @rishibhardwaj4489 ปีที่แล้ว +1

    thnku very much bhaiya for this quality content

  • @aryansen2410
    @aryansen2410 3 หลายเดือนก่อน

    solid lecture tha bhaiya jiiiiiiiiii

  • @6mahine_mein_google
    @6mahine_mein_google ปีที่แล้ว +3

    45:15 Time complexity of buildheap function is O(NlogN) because we heapify function will take logN and we r doing this for n/2 elements so tc should be O(NlogN)

  • @Ma.keITEasy
    @Ma.keITEasy ปีที่แล้ว

    You know you are beauty with brains!!

  • @pahaljain9209
    @pahaljain9209 ปีที่แล้ว

    Well Tough topic but u taught it simply thankyou bhaiya for help

  • @KaustubhPathak9
    @KaustubhPathak9 ปีที่แล้ว

    Hats off to dedication level of bhaiya for us.

  • @adarshparitosh5870
    @adarshparitosh5870 2 ปีที่แล้ว

    Thank you Bhaiya 🙏 aisa course dene ke liye, ab lagta hai kuch kar sakta hai aapn log.

  • @yashgupta4866
    @yashgupta4866 2 ปีที่แล้ว

    Best course for DSA
    Thanku bhaiya

  • @kishanprajapati3327
    @kishanprajapati3327 2 ปีที่แล้ว

    even after 6 months no had made Data Structure course like yours Babbar bhaiya.

  • @anmolkumar01
    @anmolkumar01 8 หลายเดือนก่อน

    In the deletion , At 29:06 , i think it should be
    At line 59 , inside if
    left child

  • @balvindersingh339
    @balvindersingh339 ปีที่แล้ว +4

    I think there is an error in the deletion part.
    We are first checking the left then right.
    But what if right part is maximum?
    Try making a heap this way and you'll understand:
    50 55 54 53 53
    upon deletion, we get :
    53 52 54 50: 53 becomes root and 54 comes later...

    • @ashutosh7944
      @ashutosh7944 ปีที่แล้ว +1

      there is no problem in sir code it is 100% correct
      listen if there is no need to swap in left then we swap in right side
      then this means we have to forget the left subtree for further sorting because there is no need and vice versa and this continues until all conditions fulfilled and then return
      if you dry run you will notice this:)
      believe me just dry run

    • @dipjain8679
      @dipjain8679 ปีที่แล้ว

      there is a problem,take example as 52 53 54 50 you will get wrong answer as:53 52 54 50@@ashutosh7944

    • @RidamMittal
      @RidamMittal ปีที่แล้ว

      ya you are right its wrong and incomplete

  • @ranasaad2035
    @ranasaad2035 ปีที่แล้ว

    World number 1 DSA course.

  • @shahbazkhalid6950
    @shahbazkhalid6950 ปีที่แล้ว

    Love you(in a happy mood) becuase you solved my problem.

  • @beastndvk2003
    @beastndvk2003 2 หลายเดือนก่อน +1

    Sab samaj gaya sir 🔥🔥🔥

  • @bishnoibajrang
    @bishnoibajrang ปีที่แล้ว

    Really great consistency hai sir aapki I'm not able to match till now even🌚

  • @samyakagarwal1777
    @samyakagarwal1777 2 ปีที่แล้ว

    thanks alot bhaiya , this cleared all my doubts realted to heap and heapify !!!!!!!!!!!!

  • @aayushman2024
    @aayushman2024 ปีที่แล้ว

    thankyou very much sir ,very helpful ,,Gr8 work sir

  • @soumelee5661
    @soumelee5661 2 ปีที่แล้ว +2

    in the heapify code why we put the condition left

  • @govindsuryavanshi6653
    @govindsuryavanshi6653 ปีที่แล้ว +2

    First I have completed all DSA series and now conclude this is Greatest ever DSA series to exists on youtube or paid courses. Your contribution will be remembered. You're God of DSA for us🙇‍♂ Thanks you.