7.9 Heap Sort | Heapify Method | Build Max Heap Algorithm | Sorting Algorithms

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ส.ค. 2024
  • CORRECTION: at 42:50 heapify call for delete logic would be maxheapify(A, i-1,1) and in maxheapify method instead of while loop we can write if statement. :)
    Discussed Heap sort and Heapify method to Create a Max Heap form Array. Step by step instructions showing how to run Heap Sort with its pseudocode.
    DSA Full Course: https: • Data Structures and Al...
    ******************************************
    See Complete Playlists:
    C Programming Course: • Programming in C
    C++ Programming: • C++ Complete Course
    Python Full Course: • Python - Basic to Advance
    Printing Pattern in C: • Printing Pattern Progr...
    DAA Course: • Design and Analysis of...
    Placement Series: • Placements Series
    Dynamic Programming: • Dynamic Programming
    Operating Systems: // • Operating Systems
    DBMS: • DBMS (Database Managem...
    ********************************************
    Connect & Contact Me:
    Facebook: / jennys-lectures-csit-n...
    Quora: www.quora.com/...
    Instagram: / jayantikhatrilamba
    #heap #datastructures #jennyslectures

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

  • @JennyslecturesCSIT
    @JennyslecturesCSIT  ปีที่แล้ว +173

    CORRECTION: at 42:50 heapify call for delete logic would be maxheapify(A, i-1,1) and in maxheapify method instead of while loop we can write if statement. :)

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

      Thanks!

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

      👍

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

      👍

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

      After correction also sorted output in not coming !
      -----------------------------------------------------
      #include
      void printArray(int *A, int n)
      {
      for (int i = 0; i < n; i++)
      {
      printf("%d ", A[i]);
      }
      printf("
      ");
      }
      void swap(int *A, int i, int j)
      {
      int temp;
      temp = A[i];
      A[i] = A[j];
      A[j] = temp;
      }
      void maxHeapify(int *A, int n, int i)
      {
      int largest = i;
      int l = (2 * i);
      int r = (2 * i) + 1;
      if (l A[largest])
      {
      largest = l;
      }
      if (l A[largest])
      {
      largest = r;
      }
      if (largest != i)
      {
      swap(A, largest, i);
      maxHeapify(A, n, largest);
      }
      }
      void heapSort(int *A, int n)
      {
      {
      int temp;
      for (int i = n / 2; i >= 1; i--) // build max heap
      {
      maxHeapify(A, n, i);
      }
      for (int i = n; i >= 1; i--) // deleting
      {
      swap(A, 1, i);
      maxHeapify(A, i - 1, 1);
      }
      }
      }
      int main(void)
      {
      int A[] = {4, 6, 1, 2, 45, 12, 40};
      int n = 7;
      printArray(A, n);
      heapSort(A, n);
      printArray(A, n);
      return 0;
      }

    • @ssr9589
      @ssr9589 ปีที่แล้ว +10

      I came here to tell this. I have been trying to solve this problem for 3 hours.
      Anyway, thank you.

  • @sameekasaini473
    @sameekasaini473 ปีที่แล้ว +140

    The beauty of these lectures is that even faculty learns from here to teach their students....you are amazing mam....

  • @AdityaKumar-fz8oi
    @AdityaKumar-fz8oi 3 ปีที่แล้ว +1232

    So basically we're all going to university to get our degree but we learn all the stuff from youtube tutorials.

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

      yep and always from a smart person from india, but at least this woman is beautiful!

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

      Yeah welcome to understanding India's Education System

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

      true, university is just an outline :D

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

      @@tungtruong5904 true said bro college sirf namki he lekin sab log asli padhai youtube parshe hi karte

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

      ive watched so many indian youtube tutorials , ima get hindi degree till end of college

  • @codeisawesome369
    @codeisawesome369 5 ปีที่แล้ว +210

    I’ve subscribed and turned on notifications and you didn’t even have to ask for it. That’s the mark of a quality uploader. Thank you for sharing your valuable knowledge.

  • @UnnaipolOruvan007
    @UnnaipolOruvan007 5 ปีที่แล้ว +68

    First I watched your CountingSort video...then didn’t stop watching your other videos. Thats the quality of your videos. This generation students are very lucky to have open university and talented lecturer like you in youtube. In reality all the students wont get best teacher in their classrooms. Kudos to your work, keep doing 🙏, I read so many program sites couldn’t explain clearly like you explain the example with all the iteration passes. Doing 1 or 2 iteration passes will not give deep understanding of the solution. 🙌🏻

  • @JyotiSharma-wb1vy
    @JyotiSharma-wb1vy 2 ปีที่แล้ว +12

    No other person can explain these algorithms better than Jenny Mam. Everything is explained beautifully with pictorial representation as well as with code. Thanks a lot Mam!

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

    Thanks mam. Passed my 3 semesters by watching your videos. 🙏♥️

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

    Also I for the life of me could not understand why to take n/2 as the starting point, while looking at a piece of code for Heap sort. You explained that critical bit of info with a use case. Thank you!

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

    Thank you, I really appreciate the fact that you are taking the time to do these videos, which is really good quality, top information regarding algorithms. You are an amazing teacher, I am sure you put in loads of hard work to come up with a method and solution which is easy to understand.

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

    I sometimes feel very happy that I m preparing for GATE2020😍😍really very clear explanation thankyou!

    • @lucysenpai7496
      @lucysenpai7496 10 หลายเดือนก่อน +2

      Did you cracked it?

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

      Yeah....same question....did you cracked it??

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

    Jenny your lectures are such great help! I’m relieved to have found your channel! Thank you for being so thorough with your explanations :)

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

    My university lecturer play your video in class and teach us algorithms 😂❤

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

    Actually i want to give as many as likes possible for your lecture but here he gave only one.....😍😍

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

    Most valuable gem of IT and data Science : Jenny Ma'am 😊

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

    You are only in TH-cam who explained this algorithm in structured and easy way.👍

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

    Excellent video. The concept of heap sort and heapify is easy to understand but the code can be a little complex to come up with. I tried for 3 hours and watched numerous videos and stumbled upon this gem. You earned a follower! Thank you so much!

  • @dhruvkaran9724
    @dhruvkaran9724 5 ปีที่แล้ว +5

    mam u taught like god...
    each concept is now embedded in me.

  • @superfact4556
    @superfact4556 5 ปีที่แล้ว +16

    Thanks for clearing my doubts
    ...ur teaching stye is unique

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

    Thanks a lot for this lacture. Your videos help me alot for my exams and you explain in a very good manner thanks once again.☺😊

  • @shubham-pp4cw
    @shubham-pp4cw 3 ปีที่แล้ว +2

    Explantation is excellent and simplified way.
    At (42 min)in delete method looping should start with (i=n-1) if its start with n it will give one garbage value in array

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

    Thank u mam for that grt video.
    Aap hi ho meri real DSA waali mam.
    My dsa marks credit goes to you only.
    Love you mam

  • @user-nj9nr5rt8h
    @user-nj9nr5rt8h 8 หลายเดือนก่อน +12

    My college faculty copying your lectures mam😂

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

      Same 🤣

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

      Same😂

    • @Sachin22-yt
      @Sachin22-yt 4 หลายเดือนก่อน

      C benaya tumko

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

    beauty with brain --- deadly combination

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

    A very intuitive lecture by you ma'am. All of my doubts are cleared after watching this. Very Very thank you ma'am.

  • @tarunmathur7797
    @tarunmathur7797 5 ปีที่แล้ว +27

    27:26 will start from here for revision

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

    You really are one of the best teachers for data structures and algorithms.

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

    @Jenny's lectures CS/IT NET&JRF A small correction, in the logic of sorting loop, instead of maxHeap(A, i-1, 1) we have to use maxHeap(A, i-1, 0) because the index starts from 0 and our first element will always be at index 0.

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

      Here index 0 contains sentinel value bro so we start from index 1 only

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

    i am leaning itpec and when i see your videos of all , more easy to learn and have a graet solutions for exam . i really really appreciate .

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

    Mam you r 100000 times better than my college mam..your presentation techniques is very pleasant..thank you mam to teach us in this way.❤

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

    Great lecture. Concept Explained in simplest terms. Thank you, Jenny

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

    What a great explanation Jenny! Was thinking to skip heap sort thinking its 46 min explanation but actually worth it! Now I know heap sort from leaf to root xD

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

      Leaf to root XDDD

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

    Was preparing for the internship drive(interview season), wanted a heap & heapsort revision and here it is. Saved once again :)

    • @vishaldas5692
      @vishaldas5692 3 ปีที่แล้ว

      So how was your interview...??😬

    • @himanshuyadav7327
      @himanshuyadav7327 3 ปีที่แล้ว

      @@vishaldas5692 lol😂 I got internship 🙌😇

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

      @@himanshuyadav7327 Haha great u got on this covid situation....!!🥳

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

    There should be if clause instead of while, because we dont need loop. we are just comparing the values.

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

    Thanks. Keep up the good work.U just saved my semesters

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

    you are a wonderful teacher. My whole DSA basic I clear from this channel. thanks mam. and request you to bring more content related to university subjects..
    😇🙂

  • @RahulGupta-go8oe
    @RahulGupta-go8oe 4 ปีที่แล้ว +1

    mam ur voice is soothing to my ears, very pleasant to have u as a teacher.

  • @a.jiteshsai-5012
    @a.jiteshsai-5012 4 ปีที่แล้ว +1

    My college professor and your explanation is very easy

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

    One of the best teacher on you tube. Thanks mam for all your efforts u put for students and keep making such videos.

  • @tarifhingolaja5831
    @tarifhingolaja5831 3 ปีที่แล้ว

    First for all we are converting our array into heap using heapify method.
    In heapify the we are starting from none leaf node so we are eliminating leaf node therefore we have used i=n/2; and we passing parameter as I.
    And in other for loop we are going to sort the heap and here we going to use deleting root node method for sorting therefore we passed 1 instead of i.
    Thankyou Ma'am.
    You're teaching is very nice.🥰

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

    Wonderful teaching I am now just able to remember after listening only one time and cuteness overloaded

  • @Mandeepsingh-jo5cf
    @Mandeepsingh-jo5cf 3 ปีที่แล้ว +2

    tremendous lecture on heap sort. Highly recomended.

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

    In the deletion, our array size remained same as we are sending n in it!!
    Isn't it wrong,
    I think Maxheapify(A,i-1,1) would be there?

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

      Correct bro.
      And one more thing in place of while loops there will be simple if condition in heapify function.

    • @an_son_mathew_
      @an_son_mathew_ 3 ปีที่แล้ว

      Thank you so much brother......I had the same doubt ....

    • @akshatkumar2956
      @akshatkumar2956 3 ปีที่แล้ว

      Yes you r correct because after swapping 1st element with n th. Element. We have to heapify only at n-1, otherwise it will again heapify whole array

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

      @@akshatkumar2956 But bro i-- to already loop mein ho raha ha so shouldn't we write (A, i, 1) ?

    • @HenryPangsatabam
      @HenryPangsatabam 3 ปีที่แล้ว

      @@BSEss It would be wrong as we are making the swap first and calling the Heapify. For instance, if you include the n on the first iteration of Heapify, it would be swapped with its parent (n/2).

  • @AvinashKumar-sx5ee
    @AvinashKumar-sx5ee ปีที่แล้ว

    The last dry run has cleared my doubt. Mam you are gem for us.

  • @saratchand4275
    @saratchand4275 4 ปีที่แล้ว

    Being a teacher,, you are good at your job... Let us enjoy and learn well... Fantastic..

  • @NikitaSharma-bs4gg
    @NikitaSharma-bs4gg 3 ปีที่แล้ว +4

    That was amazing explanation; i was so stuck in heap sort part :,) thanks

  • @DonGayanakaKariyawasam
    @DonGayanakaKariyawasam 7 วันที่ผ่านมา +1

    thank u miss , im computer sci student , this is very helpful

  • @geekprobin1456
    @geekprobin1456 4 ปีที่แล้ว

    Maam, your way of teaching is awesome. Thanks a lot.

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

    super mam you was mother of data structures

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

    her teaching style is same as my college professor. just amazing

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

    I think
    In the deletion part the call to heapify must be like:
    MaxHeapify(A,i-1,1);
    As if we pass n after execution it will put 15 in last again and 30 in middle so tree would not be MaxHeap anymore.
    And seperate from it
    Thankyou for being such awesome teacher😇

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

    Tyvm for explaining such a complex operations in a simple and effective way

  • @shihlihsu9918
    @shihlihsu9918 3 ปีที่แล้ว

    Always end up watching your video every SINGLE time. Thank you so much for all your tutorial.

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

    Amazing explanation mam , no one can replace mam ! Almost k watched your videos it's very useful and understandable

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

    U re explanation is super

  • @storylineonlinehamzashahid8368
    @storylineonlinehamzashahid8368 3 ปีที่แล้ว

    Mam Jinny Thank you sooo Much agaar ap na hoti tou data structure ka course parhana bhot mushkil Hota Huge respect for you mam .Luv From Pakistan

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

    Thanks a lot Miss for all your sorting videos...these has just helped me pass data structures lab !! :)

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

    Me: Where can I learn Heap sort?
    Jenny: Here only.

    • @Atharhashmisir
      @Atharhashmisir 4 ปีที่แล้ว

      आप सभी देखने वालों से निवेदन है, एक बार मेरे चैनल पर आकर ज़रूर देखें
      th-cam.com/users/AtharDhamtariplaylists

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

      @@Atharhashmisir lots of playlists...good content..wish u all the best..

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

    Hello api,, i am from Bangladesh..
    I have seen many videos about heapsort 😪😪but none of this could able to explain the algorithm as clearly+easily as you....😊😊
    You lecture just amazing💚💚💚 api❤❤ and very much helpful to me. I am very grateful to you. 🥰🥰
    Also expecting more lectures about data structure and algorithm from you..🥰😻😻😻💚💚

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

    Thanks ma'am for all the videos. It helps a lot for solving all the problems in ADA nd DS.

  • @DisruptarianRadio
    @DisruptarianRadio 5 ปีที่แล้ว +28

    "Prolific programmers contribute to certain disaster." author ~ "Niklaus Wirth"

  • @sudhamoneyjayaprakash5704
    @sudhamoneyjayaprakash5704 3 ปีที่แล้ว

    that last part were you said it is heap sort....that was like magic..i was afraid of heap sort thought it was difficult but you explained it so magically

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

    wow .. nice explanation.. i shared this video in my class group

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

    Paying lakhs in the college and these TH-cam videos are more helpful than my entire life

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

    we are going to college for completing 75%attendance but there nothing to learn but actually we learn from you tube❤❤

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

    Thank you ma'am. Your videos had helped me a lot before my exam. From your videos I could understand clearly. After that I recommended your videos to some of my friends too

  • @Forever._.curious..
    @Forever._.curious.. ปีที่แล้ว +2

    Video is long but worth it 👍 thanks ma'am we study a lot with yr lecs 👍

  • @Jatrapagala2.0
    @Jatrapagala2.0 4 ปีที่แล้ว +2

    mam your video is so long .but it is really helpful.i lave learned all sorting method only region for your lecture ..* * *************************************

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

    U r awesome mam....... tomorrow I have a sem 3 ....iam super satisfied with ur explanation mam tq......

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

    one of the best Explanation i ever heard
    😍❤
    Thank U❤ Angel❤

  • @saritakumari-oh8fs
    @saritakumari-oh8fs 3 ปีที่แล้ว

    Simplest logic explanation for complex function maxHeaify(). You are great Maam

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

    You are amazing.I looked for such a video for heap sort which is so easily understandable.Thanks mam.

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

    You explain like a pro 💓
    Thank You Soo much for this Conceptual Video 💜

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

    Very nice ..... Just a little error;
    In heapsort function in second for loop
    MaxHeapify(A,i-1,1);

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

      i had the same doubt, *(n-1) actually........thanks

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

      Yes , I also open the comment section with the same doubt.

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

      Yes, you are right..

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

      Thank you it is working now.

    • @sigma7253
      @sigma7253 3 ปีที่แล้ว

      @@manjushreej7588
      help me dude its not working
      #include
      using namespace std;
      void swap(int *x,int *y)
      {
      int temp=*x;
      *x=*y;
      *y=temp;
      }
      void maxheap(int a[],int n,int i)
      {
      int largest=i;
      int l=(2*i);
      int r=(2*i)+1;
      while(la[largest])
      {
      largest=i;
      }
      while(ra[largest])
      {
      largest=r;
      }

      if(largest!=i)
      {
      swap(&a[largest],&a[i]);
      maxheap(a,n,largest);
      }
      }
      void heap(int a[],int n,int k)
      {
      for(int i=n-1/2;i>=0;i--)
      {
      maxheap(a,n,i);
      }

      for(int i=n-1;i>=0;i--)
      {
      swap(&a[1],&a[i]);
      maxheap(a,n,1);
      }
      for(int i=0;i

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

    mind blowing explaination...now am big fan of you

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

    Very good lecture this helped me alot in my exam to score better thankyou so much

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

    I watching many videos but not understand that video very help for me

  • @7291ashish
    @7291ashish 5 ปีที่แล้ว +4

    While in deletion we have to store the value in order to make it the order of ascending as in heap sort we delete only the root node so that's we take the value of i as n.

  • @IWIAIIT-ARAHULROY
    @IWIAIIT-ARAHULROY 4 ปีที่แล้ว +2

    No wordss mam.....excellent

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

    Wow , mind blowing 😊😊😊 what a explaination

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

    Mam you are really a true teacher ❤ and your are very helpful 😊

  • @saurabhdsawant
    @saurabhdsawant 4 ปีที่แล้ว

    It took me a long time to understand what she is saying ! Not because she is bad at explaining , I was just not able to hear anything once I saw her .
    Btw ! Thanks for the info . Keep it up.

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

    Mam your explanation so nice.
    It's very helpful for me .
    You are doing a great job.
    Thanq mam 😍

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

    Good explanation with technical approach..

  • @7291ashish
    @7291ashish 5 ปีที่แล้ว +3

    Your lecture is awesome.

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

    It's a very good explanation. Keep up the good work, madam.

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

    39:22 is important....... Thanks for this easiest explanation........

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

    thank you so much for your efforts ma'am!

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

    Thq so much mam , code bhi smjh me aa gya clearly......thq so much

  • @MohdYahya-xv6sb
    @MohdYahya-xv6sb 3 ปีที่แล้ว

    Mam your explanation is always so simple and easy to understand thank you for putting these video's on TH-cam :)

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

    Today is my paper and I am so much confused about paper 🤣 firstly I think that I can,t perform good in paper . but now I am watching your videos to solve paper .so , finally I can say that I can perform best in paper🤩🥰.thanku mam💕❤️💖

  • @venkythesmart440
    @venkythesmart440 4 ปีที่แล้ว

    Mam a lot help full you'r lectures me and myfriends .upcoming generation teachers be like you teaching.so much better. I never forget you mam because.Internet using any work is done .this is possible. I proudly say.

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

    students can never survive without TH-cam (including me)😭

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

    your explanations are amazing, thank you !

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

    Didi your teaching procedure by English communication is A1 .. lv from west bengal didi ❤

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

    I asked sorting in an mnc interview and and I passed it with flying colours✨✨ because of your vedios mam thanks alot Jenny mam for this excellent explanation 😍😍

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

    Ur great mam I love Ur teaching

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

    Ma'am your teaching is just amazing and brilliant 👏

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

    The concept and the understanding the code by you is great

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

    Hey. I think there might be a mistake at the end. Lets say we have the Tree like you've drawn from the first half of the method. Our Array is now 30,17,20,1,5,10,15.
    Now we swap the first and last Element in the Array. So now its 15,17,20,1,5,10,30. When we now call the MaxHeapify method we check whether the first Element ist still the largest in the tree.Since 15 is less than 17 and 17 is less than 20 the largest Element is now 20. We swap the 20 with 15. Now we call the MaxHeapify method again but since we give the method the Array with size n it still contains the 30 at the end. Meaning the 30 would swap with the 20. So if im correct this means we have to decrement the variable n after we use the swap method in the second half of the HeapSort method so MaxHeapify gets called with n-1 instead of the full array.

    • @NitinSharma-bk7dw
      @NitinSharma-bk7dw 3 ปีที่แล้ว

      Bro it will be i only because here we are passing index and in the method definition it is consider as length if u r right kindly check for the array elements 4,5,6,7,11,67,45,67

    • @troublemaker8879
      @troublemaker8879 3 ปีที่แล้ว

      No its i - 1 that we have to call in max heapify (deletion)

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

      maxheapify(A, n-1, 1).

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

    Very well explained.