Write Priority Queue using Heap- Solution | Hashmap and Heap | Data Structure and Algorithms in JAVA

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ธ.ค. 2024

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

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

    This is gem sir. It took me a minute to process how beautifully you taught this concept easily .I have been through some other videos too but my search ends here.

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

      Glad it helped! and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

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

    Finally ,I found perfect explanation .
    I was tying to understand this from long time but was not getting any clear explanation ,but randomly I found this GEM which cleared my all doubts by its luster and shine... THANKYOU VERY MUCH FOR THIS AMAZING EXPLANATION.

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

    Perfect GURU for DSA, Nobody can teach DSA like you Sir.

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

    Your explanation was amazing! You broke it down perfectly.
    Thanks for being such a great teacher!❤❤

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

    Your explanation is second to none. Keep up the good work .

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

    Sir you are God + Gold ! Happy Teacher's Day.

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

      Thank you beta!! gold to aap mujhe bnaooge achii placements lekrr

  • @InderjeetSingh-lb5rk
    @InderjeetSingh-lb5rk 3 ปีที่แล้ว +1

    Sir this is over powered...thanks a ton!!😁😁

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

    Best Heap video ever.

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

    Seriously sir commendable job , first time thodi dikkat hui dimag me baithane me lakin second attemp me crystal clear sir

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

      Bhot ache. Mehnat rang laegi

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

    Awesome explanation..i have seen so many videos and even bought some courses..none of them was so crystal clear as this. Than You for all your efforts.

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

      Beta sbka apna apna pdane ka tarika h aur jo jo faculities h hmare paas unhone mjhse zda bache place kraye h abhi tak, to I'll say that vo mjhse zda effort daalte h apne kaam main.

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

    Tussi great ho sir jee!!! bhagwan aapka bhala kare

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

    you are magician sir too good sir Love from Indore

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

    this is very useful and crystal clear video. thank u sir for best explaination.

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

    Thanku for all the videos Sir
    You are doing a really wonderful work for all the students
    You really are inspiring many of us and we appreciate your work a lot

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

      Thank you so much. If you like the content, please subscribe and share around in your college whatsapp groups.

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

      @@Pepcoding already done sir

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

    Amazing Sir, thank you for this valuable session.

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

    Ye data.size()-1 k chakkar me pure video me confuse raha mai 😅
    But chalo end me sahi ho gaya. Awesome explanation sir.

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

      For better experience, visit nados.pepcoding.com, where you will get well curated content and career opportunities.

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

    Sir, It's fun learning with you. Thank you so much for making these awesome tutorials. I really loved it.

  • @AshutoshKumar-es8xy
    @AshutoshKumar-es8xy 2 ปีที่แล้ว +1

    Thanks sir . You are a legend

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

    Best ever found on internet 👌

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

      Thankyou beta!
      I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem.
      If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

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

    Wow👌👌maza a gaya👏🔥

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

      I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem.
      If you like our efforts, we request a review
      g.page/Pepcoding/review?rc
      You can subscribe to our channel here
      th-cam.com/users/Pepcodingabout?view_as=subscriber

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

      Already done sir

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

    Brilliant Explaining

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

    great explanation sir
    Thankyou !!

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

    nice explanation sir.. keep it up

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

    U r a dhaansu teacher🙏🙏

  • @SumitKumar-sx1oi
    @SumitKumar-sx1oi 3 ปีที่แล้ว +1

    amazing explanation

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

    18:46 sir you are making amazing tutorials ! i have a doubt here, is it mandatory for the class Priority Queue to be static here ? actually i knew basics of c++ from school and this year i started android directly with kotlin , so have this doubt in java syntax.

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

    Great explanation 👍

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

    sir aap bahut awsome ho

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

    next level explanation , thank you : )

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

      Keep supporting with your comments

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

    Why are we assuming it to be a left child to the parent in upheapify()? It can be that the function is called with the last index element being a right child to its parent. Please help clarify. Thanks!

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

    Great Explanation!

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

      Glad it was helpful!

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

    Amzing tutorial sir 👍

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

      Thankyou beta!
      I am glad you liked it. If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

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

    uttam sir

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

    Amazing.. simply the best..

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

      Thankyou beta!
      I am glad you liked it. I hope that you are watching the videos till the end. If you like our efforts, will you like to write a review about us here - g.page/Pepcoding/review?rc

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

    Really nice explanation sir.☺

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

      Thankyou beta!
      I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to write a review about us here - g.page/Pepcoding/review?rc

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

    Up heapify ka logic galat hai sir, Parent ka index calculate krne me apne ye assume kr lia ki left child add hua hai...it is possible ki right child add hua ho...so pi = (i-2)/2 is also possible

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

      floor value lenge na toh -1 and -2 dono ka cade cover ho jaega bcox when we divide it by 2 then .5 ka difference aayega and usme floor lene se cover ho jaega

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

    legend is back #sumit sir

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

    indeed, this is a search ending video !!!

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

      For better experience and well-organised content
      Visit - nados.pepcoding.com
      You can post your query on community tab.
      Don't forget to follow us on Instagram
      instagram.com/pepcoding/

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

    Sir, if we want to remove elements in descending order then how will we write the compare to function?

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

      return statement mei jo return kar rhe hai compareto function ki, uss output ko -1 se multiply kar do

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

      @@Pepcoding ye to mergeKSorted mai descending order ke liye ho sakta hai, usme to Collections.reverseOrder() bhi use kar painge but sir is question mae descending ke liye upheapify aur downheapify mai signs hi change karne padenge na?

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

    downheapify mein toh base condition daali hee nahi hui hai ?

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

      basically after swappings the recursion stops when either the current node has no children or it is smaller than both of its children, in which case no further swapping is needed and the method returns, effectively ending the recursion for that particular call.

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

    Sir make a video on how to check is binary tree a heap

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

      Ji, levelup ka question hai. dalega.

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

      @@Pepcoding ji sir daliya pls thanks

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

    sir ek video sirf comparator and comparable par bhi bana dijiye jaise aapne iterator and iterable par bnayi thi

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

      bnai hui hai. Kal dalegi. Par wo thodi gobar bani hai. Dekhna ek baar, most likely wo replace karni padegi. Usme jyada repeat kia hai same point baar baar maine. Baaki sab theik hai. Kal aaegi.

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

      @@Pepcoding No problem sir, repeat kia hai toh achi baat hai, dimaag mein set ho jaegi

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

    waiting for hashmap implementation video sir

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

      I have made it available. It is with the video-editting team. They will most likely post it 2mrw

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

    zero is sacred place ...hahhaha best explanation ever

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

      Thankyou beta!
      I am glad you liked it. I also hope that you are watching till the end and trying to understand the what, how, and especially why of the problem. If you like our efforts, will you like to review us here - g.page/Pepcoding/review?rc

  • @NiranjanKumar-cb8si
    @NiranjanKumar-cb8si 4 ปีที่แล้ว +2

    sir , hashmap ki implementaion ka video bhi do plss

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

      han beta, mai bna chuka hun. video-editting team ke paas hai. kal dalega.

    • @NiranjanKumar-cb8si
      @NiranjanKumar-cb8si 4 ปีที่แล้ว

      @@Pepcoding thank u so much sir

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

    neat!

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

      Thankyou!
      Keep learning and keep growing!😊

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

    Sir heap and hashmap ke questions portal pe upload karwa dijiye

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

      hanji, aj ho jaenge.

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

    Sir dp on trees ki separate playlist will be helpful :-)

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

      Will you upload it ?

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

      Yes, sure. Ek baar enough volume ban jane dijie. Organise tarah tarah se kar denge.

  • @SKM-ti6bh
    @SKM-ti6bh ปีที่แล้ว

    When you are saying ‘higher value element have lower priority’ please say the reason behind this , as a hint.

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

    Tree k chasma

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

    Tough DP, GREEDY QUESTIONS

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

      Aaega, aaega.