1 Heap Introduction and Identification

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

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

  • @Apurva-Sonavane
    @Apurva-Sonavane 4 หลายเดือนก่อน +12

    The man, the icon, Aditya Verma. You taught me DP, I cleared Microsoft.

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

      Hi can you please tell from where to do graphs and trees

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

    This is one of your subscriber. I'm lucky to find your videos on youtube. Ive gone through every single video of yours that exist on youtube. Hands down content. Immensely satisfied. Nobody Nobody teaches better than you do. Could you please make more videos on topics like Trees-segment trees, Tries and graph. Please dont stop making videos. This world needs you and more like you(which I don't find anyone else other than you).

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

      Thanks a lot brother !! Really this mean a lot to me, Thanks.
      And yeah I haven't stopped making video, just kind of stuck as of now due to lockdown. Definitely will be uploading more content in near future !!

    • @pankajkumarjha5-yriddcompu269
      @pankajkumarjha5-yriddcompu269 3 ปีที่แล้ว +9

      @@TheAdityaVerma have completed your Videos on DP, Stack and going through heap.. please upload videos on Tree and Graph as well bhaiya... Immensely Immensely satisfied..

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

      @@TheAdityaVerma bhaiya plz graph and backtracking ka bhi bna do 🙏🙏

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

      @@TheAdityaVerma plz upload make video on graph and tree the way u explain is awesome

    • @MuhammadIrfan-cj1cq
      @MuhammadIrfan-cj1cq 2 ปีที่แล้ว +5

      @@TheAdityaVerma kb kroge bhaiya v waiting....
      intern bhi to lgwani h
      really love the u teach :)

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

    You are someone who gives any of the average student that confidence that even they can understand this programming concept . You are a great teacher .

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

    If someone is Thinking to go with this playlist I just wanted to say Don't think just go and learn its amazing

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

    The real mentor of all tire-3 guys.... 🙏

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

    Bhai Sahab! I have been a subscriber of you channel from the time there was 1k Subs on this channel. You are one of the best teachers who clears concept in simplest format! Awesome!

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

    I am now your patron on Patreon. I never became a patron before. But looking at this content I think it is worth it.

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

      Glad you think so Nikhil ✌️❤️

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

    Never seen any tutor who put so much effort to make sure even small things are cleared by re-iterating multiple times. Thanks a ton for your content which is saving a lot of efforts scrolling over the internet or by wasting money on fraudsters.
    You should probably start as a full-time educator :)

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

    # HI BOSS
    Boss I am also from your college (MACT).
    BOSS Aapki video dekh kr dil khush ho gaya

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

    best tutorial for heap, best teacher on youtube ,waiting for other data structures also

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

    Flipkart ka base=16 hai or CTC 24 hai , best programming content on youtube ,big fan Aditya bro .

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

    yaa man, we are waiting for your backtracking series and also Hashing. man you transforming lives over here . respect

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

    Best explanation of Heap.I always had hard time in understanding Heap but finally understood it.
    Please make more videos on Graphs and Strings.

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

    Nice explanation sir....thanks for the playlist...doing a really great job..

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

    Loved the "koi chakkar wali baat nahi hai sab samajh aa jayega 2 min mein"
    I am an SDE-2 in a Product Based startup and one thing that I have run away from is DSA. HLD, LLD round I can clear very easily but I always refrained from studying DSA. The interviews that mostly focused on system design were easily cleared but DSA-focused interviews were problematic for me. This series has been so clear and informative. Thanks a lot, Aditya for this valuable content. FAANG soon

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

      Bhai tum karloge crack maang easily. All the best.

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

      Hi @sushant
      My case is exactly the opposite of yours. I always refrained from learning HLD, and LLD and one of the reasons is, that I never got any good resources for that. We have already got an awesome DSA playlist of Aditya, you can go through it.
      Please share some good resources to start HLD, and LLD if you have them.
      Thanks

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

      @@mayankmohit3414Gaurav Sen yt for system design, for documentation oo design website.

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

      Layoff soon XD

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

      @@pranav288 eggh what

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

    Bhai itni acchi explanation ko dislike kaise kr lete hai log bhai ?

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

    Excuse Me Sir
    Good Evening Sir
    Excuse me Sir
    Love from NIT Bhopal Sir😇

  • @AdityaVerma-vc2wq
    @AdityaVerma-vc2wq 4 ปีที่แล้ว +2

    why we do vextor in min heap @19:08

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

    so after the dp series, back to your channel, literallly very vey excited for this series!!!!!

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

    I just only say , THANKS MERE BHAI ❤❤

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

    thank you for ypur videos they are better standard than paid courses

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

    your way of teaching is awesome..please make videos on backtracking and trie.Please continue making videos..earlier used to hate ds but because of your videos and lucid way of explanation I started enjoying it and able to solve lot of questions

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

    Just watched this heap playlist, Its superb !!
    I really appreciate your work.
    Pen n Paper > PC

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

    plz plz send more and more viodes excellent ......one of the ever ds concept proud of u bade bhaiya

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

    Best approach to identify a heap problem. Thanks a lot

  • @039saranshvashisht8
    @039saranshvashisht8 3 ปีที่แล้ว

    best explanation of heap in all the videos i have seen on this topic

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

    Aditya u r a very fantastic teacher.So lucky that I found your vedios..bhott achi explaination...SB smjh aya....plz keep making such vedios on other DSA topics as well.

  • @varunsen2802
    @varunsen2802 8 หลายเดือนก่อน +14

    Implementation of heap in java
    Min Heap --> PriorityQueue pq = new PriorityQueue();
    Max Heap --> PriorityQueue pq= new PriorityQueue(Collections.reverseOrder());

    • @Abhisheksdt
      @Abhisheksdt 5 หลายเดือนก่อน +3

      In other term Implementation of Heap in java
      Min heap --> PriorityQueue pq = new PriorityQueue();
      Max heap --> PriorityQueue pq = new PriorityQueue((a,b)->b-a);

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

      🎉​@@Abhisheksdt

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

    Commiting myself to practice atleast 1 coding problem daily. Will be updating here! Kudos to your amazing efforts bhaiyaa

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

    bhaiya 1 idea hai same heap (stl) ko use karne ka :- just reverse the sign i.e -1* (element) while inserting and while popping out again multiply it by -1 this way we can use same heap function(stl) for min and max heap correct me if I am wrong.. lekin bhaiya aik shanbd mai = "MAZA AA GAYA!" more such videos needed!

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

    I watched your first video.good explanation.every student will be understand it.

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

    Thanks a lot!Will complete this series today!

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

    brother waiting for your backtracking series...

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

      Yes bro

    • @jonu.1504
      @jonu.1504 ปีที่แล้ว +2

      Your wish fulfilled after 3yrs. He started backtracking series few weeks back.

    • @ATULKUMAR-ep8sw
      @ATULKUMAR-ep8sw 10 หลายเดือนก่อน

      @@jonu.1504Exactlyyyy

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

    abhi start bhi nhi kra mene apla video me smj gya aap bohot mst padhte ho

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

    bhai big fan ,great work...your videoes are cristal clear bro...thanku for these videos

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

    god level explaination of the time complexity! Have done heaps before but not with this clarity!! Please make a series on backtracking!

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

    Bhaiya, apne heap ko stack se samjhaya par heap is a tree-based data structure. Confused.......plz reply

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

    Please teach GRAPHS, I am having a hard time there

    • @ROHIT-gv7xk
      @ROHIT-gv7xk 3 ปีที่แล้ว

      yes bhaiya

    • @aman-tl9gd
      @aman-tl9gd 3 ปีที่แล้ว +1

      what exatly are u finding hard in graphs ? I guess topological sort , mst are some tough topics ??

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

      @@aman-tl9gd would you tell me from where should i do Graph?

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

      would you tell me from where should i do Graph?

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

    Bhaiya pure DS ke playlist daalo na.
    Aap jabardast samjhaate ho..great

  • @Anashwar-p3w
    @Anashwar-p3w 4 หลายเดือนก่อน

    i madara uchiha hereby declared you the finest and strongest dsa teacher in whole youtube

    • @Deepakkumar-pm2kt
      @Deepakkumar-pm2kt 3 หลายเดือนก่อน

      ok bro, starting this playlist after your comment. Was searching for a latest comment rest are yrs old.

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

    Bhaiya aap ki saari videos awesome he but aap ne kaha tha ki app graph and tree me se ekk topic suru karenge july 2021 se so please complete your promise we are waiting for graph and tree series. Thank you so much and lots of wishes for you.

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

    bhai ki class bole to ek number!!!

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

    Dheeraj rakhe, koi chakkar wali baat nahi hein, abhi samajh mein ayega 2 minute mein😅😂

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

    Thanks for the wonderful explanation bhai!

  • @49-farhaanali86
    @49-farhaanali86 11 หลายเดือนก่อน

    This guy is such a gem>>>>>>

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

    Hi, I am a student from NIT-Durgapur and can't really express how helpful your DP videos have been. I am definitely sure the heap videos are gonna be great too. And as a subscriber I have one request..please maybe try uploading more videos on various Data Structures and Algorithms..

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

      Are bhai tumi o durgapur a , naki bari chole gacho.... DP'r video gulo shotti e darun chilo, gfg te onek gulo practice korlam, tomar ki khobor, Actually amio DGP te tai excited hoye gachilam😂😂😂 Sorry to be creepy af😁

  • @MohitGupta-ri9hf
    @MohitGupta-ri9hf 4 ปีที่แล้ว +5

    Hey Aditya, Please answer this. What if we use min heap instead of max heap I think it will give complexity as Klog(N) since we need basically two need steps first is to heapify the array using heapify (shift down heapify) which will take O(N) time and later pop k no. of nodes which will take O(Klog(N)) time.
    Isn't Klog(N) is better than Nlog(K) because we are putting N in log which is a bigger number and log will make it smaller which overall decrease the value of my expression .
    I really liked your video.

    • @VishalSharma-hq5ti
      @VishalSharma-hq5ti 3 ปีที่แล้ว +1

      No, let say if k ~ N then your algo will take ~ O(N logN) but aditya's algo will take ~ O(N)

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

      @@VishalSharma-hq5ti That is correct. But if k

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

      @@vishvapatel3641 and not to mention, the k usually IS

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

    Is this aproach enought to solve "Minimum adjacent steps to reach the Kth smallest number"??

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

    Thanks bro , please make a playlist on linked list and trees ..

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

      Will try !! Next is Binary Search tho !! I was asked a question in my flipkart interview regarding binary search so I though it would be better to get it done first.

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

    correct me if im wrong but hum n times insertion perform kr rhe hain and heap ki insertion O(log n) time leti hai toh time complexity toh O(nlog n) yahan bhi hogyi jaise sorting mein thi, lekin agr hum kth smallest mein minheap banaye n size ka toh heap ka construct O(n) time lega then k-1 times pop krlein toh O(n+(k-1)log(k-1)) time mein solve hojayega. Is it correct ? Pls do tell
    edit: Sorry for the doubt i understood basically hum insert humesha log k size ke heap mein kr rhe hain toh hr operation ke liye max time log k lagega hence O(n log k) .Great concept indeeed 👏❤

  • @shreya-rs1fr
    @shreya-rs1fr 4 ปีที่แล้ว

    loved your paper & pen tricks.

  • @GauravKumar-xz9uk
    @GauravKumar-xz9uk 3 ปีที่แล้ว +2

    more valuable than a paid course

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

    17:48 implement karne me aisi ki taisi ho jayegi.. cant stop laughing. :D

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

    This is really good for revisions!

  • @SahilSharma-ug8xk
    @SahilSharma-ug8xk 3 ปีที่แล้ว +6

    As k is always lesser than n. So O(k log(n)) should be preferred over O(n log(k)) . So if we use the std::priority_queue (min) for kth smallest element with the predefined array. So making priority_queue will be O(n). then we can pop the k top elements .
    so it can be O(k log(n)) .
    can someone clarify this ?

    • @RaviSingh-qd5pz
      @RaviSingh-qd5pz 3 ปีที่แล้ว

      The time complexity when we use min priority queue will be O(n+klog(n)) as we also need to include the complexity to create a min heap of n elements intially. So, the complexity will be more like linear (O(n)) than logarithmic. Hence the second method is preferred.

    • @SahilSharma-ug8xk
      @SahilSharma-ug8xk 3 ปีที่แล้ว

      @@RaviSingh-qd5pz hi , but O(nlogk) is more than linear . With k > 2

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

      @@RaviSingh-qd5pz But then we need to create maxheap, and it also consume time for heapify. Thoughts?

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

    bhaiya graph par kuch videos banayiye

  • @Forever-lx5td
    @Forever-lx5td 2 ปีที่แล้ว

    Wow excellent teaching😇

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

    Great video boss

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

    7:00 But in worst case when k == n; then the nlogk will become nlogn --> Then we can use sorting too right?

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

    Hi @Adiya Verma, I read kth largest/smallest can further be optimized to O(N) instead O(NlogN) using the partition, could you please share the partition solution too if possible?

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

    Hey buddy nice job, really nice explanation 🔥🔥

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

    Ye banda, medical walo ko bhi software engineer bna dega. I guarantee.

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

    I am lucky to find your videos 🤩🤩

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

    by adding all elements to the heap, the complexity anyways became nlogn as one insertion in heap is logn. Im not sure how nlogn becomes nlogk.

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

    if we do in c, for kth/k smallest we can do min heap. For kth/k largest we can do max heap only

  • @AbhishekKumar-eh6zy
    @AbhishekKumar-eh6zy 3 ปีที่แล้ว +1

    what's the basic difference between heap and priority_queue

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

    Cool video... So clearly explained bro 😊

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

    Please make vedeos on graph and trees

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

    I think for kth smallest we will use min heap and for kth largest questions: max heap in JAVA
    Bcoz in java it's implemented via priority queue and u told by stack in c++.
    Correct me if I am wrong

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

      u r right man,the same mistake he did in dp series where he mixed up memoization with tabulation.

  • @positive-happy-bright
    @positive-happy-bright 2 ปีที่แล้ว

    Amazing explaination

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

    I think if we use build heap that will take 0(n) and the retrieval of k elements will take 0(logk) . So the complexity will come down to 0(n+logk) which is equal to 0(logn).

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

      no, when we create a heap using heapify it takes o(n) and when we remove k elements, each will take logn so the time complexity will be klogn. and what he is doing is not heapify, he is inserting elements one by one which will take nlogk time, even tho he is removing k+1th element, he is still inserting it before removing it. so idk which is better klogn or nlogk

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

    bt ismei radix sort se O(n) ki complexity bhi to achieve kr skte h?

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

    Best content 👍
    Please make series on graph and hashing.

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

    just to add we can also use quick select method in these type of problems that run on average O(n)

  • @ShreyaSingh-vr9qi
    @ShreyaSingh-vr9qi 4 ปีที่แล้ว +4

    Nice explaination bro, keep making videos on DS, Algo.

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

      Thanks ! Yeah work is at progress !!
      Please like the video to help it reach to more audience.

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

      @@TheAdityaVerma very nice..when are the next set videos coming?

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

      @@skmn07 did you watch all of it bro?

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

      next is binary search and coming soon

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

      @@TheAdityaVerma cool. Can you pls post tutorials on greedy problems and graph problems

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

    Bhai recursion aur backtracking ki bhi upload kardo

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

    please make videos on trees .I have completed stack playlist binary search .

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

    Aditya Bhaiya OP hai :)

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

    Love you brother.Your video is very helpful
    Thank you

  • @M.m554
    @M.m554 ปีที่แล้ว

    Plz upload more on trees🌳 graphs... 🙂

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

    At 13:37, you said that when the size of heap is greater than 'K', then we pop the top element and push the current element... But shouldn't it be something like we should pop the top element only if the current element is less than/ greater than (according to question) the top element? In this question, shouldn't we do something like this:-
    If (q.top()>arr[i]){
    q.pop();
    q.push(arr[i]);
    }
    I'm not sure, just asking.
    And again, thanks for this awesome content brother! Liking and sharing this channel. :)

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

      We dont push, we assume by the implementation of the heap that the insertion happens perfectly in sorted order. Because of this we can safely always say that the largest element is at the top

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

    Bhai hasing and map ka playlist banado please

  • @9a56mahabirjaiswal9
    @9a56mahabirjaiswal9 3 ปีที่แล้ว

    Bhaiya you don't have any playlist of sorting ?

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

    I code in Python. If I want to use max heap or min heap without implementation which libraries should I use?
    Heapq is only for min heap. What about max heap?

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

      use negative values on the heap.

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

    Bhau heap , heap sort ,quick sort ye sab implementation DSA interview k liye kitna imp hia?

  • @Sona-hb8dm
    @Sona-hb8dm 6 หลายเดือนก่อน

    your channel will be viewed by everyone so ,its should be useful hoping u will reach out in English..

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

    If the Array is in decreasing order ie. [10,9,8,7,6,5,4,3,2,1] and K=3 , Then it will not work right as It will remove 10,9,8 in 3 iterations and on the last iteration it will return Top element which will be 7 but our answer is 3(as 3 is the 3rd smallest number). Can someone help me clear this doubt ?

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

      Ans is 3 . k=3 means not to be 3 times iteration but iteration of every element present in the given array. max 3 elements present inside the heap.4 th element add hone ke bad top me Max value hoga wo pop ho jayega . I think it must be helpful to you .

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

      @@payalbhattamisra6985 Yes I figured it out later. Thanks

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

      @prabhat pandey most welcome 😊

  • @SandeepKumar-rt2cz
    @SandeepKumar-rt2cz 4 ปีที่แล้ว

    Bro we need more video on different topics love from Haryana 😘

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

    Please upload videos on tree and graphs

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

    Please can you make vedios on trees or tell me where can I study tree data structure (except for geeks ) for interview preperation. It will be a great help

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

    You are too good to be true.

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

    Bhaiya sets, priority queue, quick select algorithm.. In par bhi videos banao please

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

    One question, we were trying to pop elements if size of stack > k, why dont we stop reading elements once size == k?

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

      There can be further smaller elements in array, that's why we traverse the whole array and stop at the end taking the top of heap as answer

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

    waiting for backtracking series...btw love to watch ur vdos

  • @pppp7860-q1x
    @pppp7860-q1x 5 หลายเดือนก่อน

    Can anyone please tell me this dsa playlists are in c/c++ or java ???

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

    Can someone tell me ,will these videos on heap is enough for basic understanding??

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

    bro apne kya ashish vishnoi sir se jee ki preperation ki thi...because of teaching idea

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

    For Java devs declarations are:
    PriorityQueue maxHeap = new PriorityQueue(Collections.reverseOrder());
    PriorityQueue maxHeap = new PriorityQueue();

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

    plz bro keep on making such video😊

  • @ArpitKumar-yo6up
    @ArpitKumar-yo6up 2 ปีที่แล้ว

    Thank you aditya bhaiya