Introduction to Heap Data Structure + Priority Queue + Heapsort Tutorial

Ғылым және технология

In this video, we'll delve into the fundamentals of the heap data structure, explore priority queues, and walk you through a comprehensive heapsort tutorial. Whether you're preparing for a coding interview or just eager to expand your data structure knowledge, this tutorial covers theory, practical coding examples, and an in-depth look at how it all comes together.
👉 Resources
- Join Replit: join.replit.com/kunal-kushwaha
- Lecture code: replit.com/@KunalsReplit/Heaps-1
- Complete Java DSA playlist: • Java + DSA + Interview...
- Code, Assignments, & Notes: github.com/kunal-kushwaha/DSA...
Take part in the learning in public initiative! Share your learnings on LinkedIn and Twitter with #DSAwithKunal & don't forget to tag us!
➡️ Connect with me: kunalkushwaha.com
👨‍💻 Join WeMakeDevs: wemakedevs.org
======================================================================
Timestamps:
0:00:00 Introduction
0:01:58 Why heaps?
0:10:02 How heaps work
0:21:40 Inserting items in a heap
0:28:20 Removing items from a heap
0:35:15 Code
0:50:32 Heapsort
0:55:45 Priority Queue
0:58:03 Creating a heap from an unsorted array
1:09:14 Closing remarks
#heap #placement #dsa #computerscience #faang

Пікірлер: 273

  • @KunalKushwaha
    @KunalKushwaha9 ай бұрын

    👉 Resources - Join Replit: join.replit.com/kunal-kushwaha - Lecture code: replit.com/@KunalsReplit/Heaps-1

  • @poorpanda9033
    @poorpanda90339 ай бұрын

    Take your time kunal to make this videos. People are saying complete it ASAP & all. But I know it takes a lot of time & hard work to make videos. It's not that easy to Record, Edit, Render, Make thumbnail. There are so many things that can go wrong (maybe you forgot to record, rendering issues etc) So, Just to let you know take your time with these videos. Because I know that this videos are the best & it's the only thing that you need to watch to understand DSA. Being watching your videos since 2months (LinkedList, Search, Trees) It's helping me a lot. Thank You so much !!

  • @HariHaran-oq7wr
    @HariHaran-oq7wr9 ай бұрын

    Thalaiva....va thalaiva va thalaiva 🔥

  • @Jyothirmai1111
    @Jyothirmai11119 ай бұрын

    Finally Dsa with kunal is back.... Hope u complete this series soon

  • @HeyMr.OO7

    @HeyMr.OO7

    9 ай бұрын

    Yeahh by Dec 2023 he says 👍🏻

  • @agramkapoor6569

    @agramkapoor6569

    9 ай бұрын

    ​He told in the video?

  • @HeyMr.OO7

    @HeyMr.OO7

    9 ай бұрын

    Yeahh recent Tree video or questions video I asked by when series will complete he said it'll be completed by Dec 2023

  • @Jyothirmai1111

    @Jyothirmai1111

    9 ай бұрын

    Hey what if we r unable to do a question on our own?

  • @isaacreyes4915

    @isaacreyes4915

    9 ай бұрын

    @@HeyMr.OO7 No way he will finish by Dec. Still missing DP and Graphs.

  • @gojosatoru988
    @gojosatoru9889 ай бұрын

    This series is just ....... I literally have no words to explain how much helpful it is.❤❤❤ A big big thanks for making these videos, Quality content for free!!!!!!

  • @bla8275

    @bla8275

    9 ай бұрын

    Bruh...Kindly tell is this playlist also for beginners who don't know about Javaa but learned C program during 1st sem

  • @gojosatoru988

    @gojosatoru988

    9 ай бұрын

    @@bla8275 Yup.... The playlist covers the whole basics...

  • @ritanshubirla6714
    @ritanshubirla67149 ай бұрын

    The last concept, in which we are getting the time complexity for creating a heap with an unsorted array was a Banger.....learned something new .... looking forward to learn more good concepts and great topics like Graphs and DP from you ! Thank you🙏

  • @KunalKushwaha

    @KunalKushwaha

    9 ай бұрын

    Thanks for sharing!

  • @soumiksen7445
    @soumiksen74459 ай бұрын

    39:10 to 39:15 , I literally died laughing watching that part 😂😂😂

  • @pavithas1114

    @pavithas1114

    Ай бұрын

    Me too

  • @HB-nw2cb
    @HB-nw2cb9 ай бұрын

    Hi sir I'm from Norway, please keep making these videos, I'm having the algorithm course now and I really need your videos!!

  • @kevinkenei4725
    @kevinkenei47259 ай бұрын

    maaan thanks kunal for interpreting these dsa topics this way, you made them soo simple that with your assignements i get the confidence to crack faang interviews just in time thanks alot !!

  • @trailblazer3465
    @trailblazer34659 ай бұрын

    Thanks Kunal for starting again. Please continue 🙏

  • @AtharvaRao0104
    @AtharvaRao01049 ай бұрын

    Everybody who has not understood data structures yet just waits for your videos .. and you make it look so simple .. I'm sure those who watch these will never forget the concepts again in their life.

  • @KunalKushwaha

    @KunalKushwaha

    9 ай бұрын

    Thank you

  • @mohammadmoinuddin8895

    @mohammadmoinuddin8895

    9 ай бұрын

    ​@@KunalKushwaha it would be a great ,if u complete the dsa course asap , because no one teaches as simple as u

  • @bla8275

    @bla8275

    9 ай бұрын

    Bruh...Kindly tell is this playlist also for beginners who don't know about Javaa but learned C program during 1st sem

  • @chiragaggarwal480
    @chiragaggarwal4809 ай бұрын

    Thank your so much kunal.... was waiting for youu...!!

  • @ediscage
    @ediscage7 ай бұрын

    Kunal you are great, you have helped me a lot on this journey of learning DSA in my university, I have been able to do labs and stuff with no problem , thanks a lot, I have been waiting for you to make videos on graphs and DP, we need you man !!!!

  • @VinayKumar-zt1be
    @VinayKumar-zt1be9 ай бұрын

    Was waiting eagerly for the video. Thank u and please complete this DSA playlist beacuse i am going to sit in the placements from next semester.

  • @isaacreyes4915
    @isaacreyes49158 ай бұрын

    Thanks, really appreciate you taking the time to teach us!

  • @balulucky4457
    @balulucky44579 ай бұрын

    Tqs kunal waiting for ur video bcz No u tube lecture as teach as u ❤❤

  • @ABHISHEK-E-VECTOR-jo1pc
    @ABHISHEK-E-VECTOR-jo1pc9 ай бұрын

    Awesome video Kunal sir ❤❤

  • @27_sakshijadhav2
    @27_sakshijadhav29 ай бұрын

    My Favourite language is c++ , and i am doing coding in c++ only but looking to your teaching techniques and skill i used to watch your dsa series Thank you for such a incredible content 🙏🙏

  • @Ashritha_purna
    @Ashritha_purna9 ай бұрын

    Thank you so much kunal for the video❤ and super excited for the next questions video.

  • @dineshaher9634
    @dineshaher96349 ай бұрын

    Thank you so much bhaiya for the high quality content❤

  • @satestactmathtutor6570
    @satestactmathtutor65709 ай бұрын

    Finally, my man is educating the whole youtube with the best DSA

  • @vakulkeshav4324

    @vakulkeshav4324

    9 ай бұрын

    Hey, I have just started with DSA course currently learning arrays, just wanna ask you if this course is good like is everything covered till now. Basically I want your honest opinion regarding this course or any other suggestions.

  • @gojosatoru988

    @gojosatoru988

    9 ай бұрын

    ​@@vakulkeshav4324I can't explain how good this series is. The teaching style, the content, explanation everything is just top notch. You can't get this type of quality content even in a paid course. Believe me bro....just watch this series and you will be solving medium and hard leetcode questions (for interviews) in no time.... Just be consistent 😊

  • @zanies6288

    @zanies6288

    9 ай бұрын

    ​@@vakulkeshav4324This is great course but I would recommend you to watch advance topics like dp, trees and grap from striver/aditya verma also

  • @Vortx110

    @Vortx110

    9 ай бұрын

    @@vakulkeshav4324 bro this is the best course out there trust me my friends have taken courses from coding ninjas gfg and chapri ytubers like babbar and sapna college but ultimately they are also watching kunals course only this is gem brother follow this course u will become great but indeed pratice is needed for sure u can do that on leetcode

  • @Dicegambler-r8h

    @Dicegambler-r8h

    9 ай бұрын

    @@vakulkeshav4324 How much Java (or whatever language you know) is enough for learning DSA?

  • @tushargoswami6622
    @tushargoswami66229 ай бұрын

    Thank you Kunal 🤝

  • @sharath_29
    @sharath_299 ай бұрын

    Was waiting for this.. finally 🔥🔥🔥🔥🔥

  • @suravipanigrahi8507
    @suravipanigrahi85079 ай бұрын

    Great stuff clear the concept in one short

  • @upendrakumar-bw1jd
    @upendrakumar-bw1jd6 ай бұрын

    So many people making it complex but You made heaps really simple.

  • @sachinsingh6244
    @sachinsingh62449 ай бұрын

    THAT'COOL KUNAL , Waiting for the Next

  • @user-oz3hc6lj2e
    @user-oz3hc6lj2e8 ай бұрын

    I am really grateful to you for creating this video

  • @curiousmanash8154
    @curiousmanash81549 ай бұрын

    Just explanation is in motion . loved it❤

  • @trailblazer555
    @trailblazer5557 ай бұрын

    Easily understood..!! Thanks Kunal...

  • @AdityaSharma-it5ue
    @AdityaSharma-it5ue6 ай бұрын

    A big Thank you for these awesome videos!

  • @nikolatesla399
    @nikolatesla3997 ай бұрын

    One of the best video on heaps ..❤

  • @sakshamjoshi1118
    @sakshamjoshi11189 ай бұрын

    Here comes the most awaited video of the Supreme DSA Playlist ❤ U r the Best Tutor❤❤

  • @bla8275

    @bla8275

    9 ай бұрын

    Bruh...Kindly tell is this playlist also for beginners who don't know about Javaa but learned C program during 1st sem

  • @sakshamjoshi1118

    @sakshamjoshi1118

    9 ай бұрын

    @@bla8275 yes of course

  • @amazingvideos5398
    @amazingvideos53989 ай бұрын

    this video deserves q10000+ cmnts why only 172 ? hats off to you kunal

  • @sathwikyadalam
    @sathwikyadalam9 ай бұрын

    Great Course Kunal!

  • @kavierjogie6694
    @kavierjogie66949 ай бұрын

    Thanks Kunal, Your videos are really helpful.

  • @nikhil7947
    @nikhil79479 ай бұрын

    Great bro keep it up❤

  • @vaibhavimishra763
    @vaibhavimishra7639 ай бұрын

    God bless u❤ , really great great work sir, no one can provide such an awesome course, pls sir provide remaining topics also

  • @its_shivam_jha
    @its_shivam_jha9 ай бұрын

    I haven't reached this video yet . But thank you for continuing the playlist.

  • @NeerajSingh-mc5kf
    @NeerajSingh-mc5kf2 ай бұрын

    I enjoyed watching this complete videos Great work Kunal

  • @prettylilnerdy6802
    @prettylilnerdy68027 ай бұрын

    I would even pay for this course such great way of teaching. And please go ahead with DP

  • @elco7956
    @elco79569 ай бұрын

    Long awaited

  • @abhinavmathur6072
    @abhinavmathur60729 ай бұрын

    thank you bro ❤️Great work you are doing ✌🏻👀 will comment after watching :)

  • @vasudevsurwase9660
    @vasudevsurwase96608 ай бұрын

    This series is amazing ,and also really helping while going to the iinterview . please upload graph videvos

  • @LavKushwaha
    @LavKushwaha9 ай бұрын

    Finally, king is back with his new super duper video.❤️‍🔥🔥 Thank you for providing such an amazing DSA course for free on KZread. Huge respect. 💯 ❤️🙌

  • @bla8275

    @bla8275

    9 ай бұрын

    Bruh...Kindly tell is this playlist also for beginners who don't know about Javaa but learned C program during 1st sem

  • @Saurabhkumar-kl3or

    @Saurabhkumar-kl3or

    8 ай бұрын

    @@bla8275 how many times bro u asking ofcourse it is for beginners bro

  • @rashisahu9587
    @rashisahu95879 ай бұрын

    Superb video

  • @azadsinghdinkar3951
    @azadsinghdinkar395124 күн бұрын

    Outstanding explanation

  • @jaymahakaal5354
    @jaymahakaal53549 ай бұрын

    lol fang youtubers were criticizing him for not completing his DSA series meanwhile they themselves haven't done anything for the community for free. Atleast he was trying to do and Now he is back🙌❤

  • @Adityasingh-tq4nt
    @Adityasingh-tq4nt9 ай бұрын

    Good work 👍

  • @sasikanth8378
    @sasikanth83787 ай бұрын

    no can provide this high quality teaching

  • @Siddharthsirsate77
    @Siddharthsirsate779 ай бұрын

    Keep them coming

  • @TanushkaKashyap-cf7sd
    @TanushkaKashyap-cf7sd25 күн бұрын

    You doing a great job K!

  • @pramithasdhakal5367
    @pramithasdhakal53679 ай бұрын

    One thing to note is that since we are shifting and not replacing the elements while swapping, if will be creating duplicate elements in the list. E.g. If the original list is [34,45,22], after swapping first and last elements, the list will look like this: 22,34,45,34,22. So, better to use Collections.swap() instead.

  • @sysybaba420
    @sysybaba4206 ай бұрын

    "Java doesn't have pointers so you get my point" framing this!

  • @Zunan263
    @Zunan2639 ай бұрын

    Kindly keep posting

  • @Doremonspocket
    @Doremonspocket4 ай бұрын

    You made it simple!

  • @joejangala
    @joejangala9 ай бұрын

    Playlist is getting better and better.....

  • @mahendrakolhe6263
    @mahendrakolhe62639 ай бұрын

    Thanks Kunal ❤

  • @chaman3679
    @chaman36796 ай бұрын

    huge respect to you 🙏

  • @mahirr8090
    @mahirr80909 ай бұрын

    Thanks kunal ❤️

  • @vikrant9272
    @vikrant92729 ай бұрын

    We're getting close to most complex topics Soon. Thank You Kunal!!!

  • @prajwalm.s7976

    @prajwalm.s7976

    9 ай бұрын

    But Kunal will make them easier

  • @vikrant9272

    @vikrant9272

    9 ай бұрын

    @@prajwalm.s7976 For Sure

  • @ankur07M

    @ankur07M

    9 ай бұрын

    Dynamic programming??

  • @vikrant9272

    @vikrant9272

    9 ай бұрын

    @@ankur07M Yes Graphs, DP, Greedy

  • @iit-b3869

    @iit-b3869

    9 ай бұрын

    ​@@vikrant9272can you please tell all the remaining topic I think hashmap trie and many. Can you tell all one

  • @sahebraojadhav9727
    @sahebraojadhav97279 ай бұрын

    Thank you @kunal

  • @HARI-iy5uv
    @HARI-iy5uv9 ай бұрын

    Back on track 💥

  • @_PoojaDahifale
    @_PoojaDahifale9 ай бұрын

    Such a appreciating work done by you sir... We are very thankful to you for providing the better quality of source of education to enhance the skills... 🙌

  • @bla8275

    @bla8275

    9 ай бұрын

    Bruh...Kindly tell is this playlist also for beginners who don't know about Javaa but learned C program during 1st sem

  • @cliffeflash3166

    @cliffeflash3166

    9 ай бұрын

    ​@@bla8275yes you can start

  • @ranjitgalande2388
    @ranjitgalande23889 ай бұрын

    best course on KZread

  • @sravansunkara9145
    @sravansunkara91459 ай бұрын

    I don't know why I'm crying, thank you man! LIVE LONG, STAY STRONG AND HEALTHY. MUCH LOVE TO YOU!

  • @KunalKushwaha

    @KunalKushwaha

    9 ай бұрын

    You’re welcome

  • @bla8275

    @bla8275

    9 ай бұрын

    Bruh...Kindly tell is this playlist also for beginners who don't know about Javaa but learned C program during 1st sem

  • @adeel47896
    @adeel478967 ай бұрын

    What a Man, no word to say

  • @ujjwalshrivastava-xs5lx
    @ujjwalshrivastava-xs5lx9 ай бұрын

    Thank you❤

  • @rishipatel4553
    @rishipatel45538 ай бұрын

    thanks bhaiya..

  • @shetysify
    @shetysify9 ай бұрын

    Legend is back !!

  • @Adonis08
    @Adonis089 ай бұрын

    the best video🔥🔥🔥🔥

  • @jayvyas9700
    @jayvyas97002 ай бұрын

    Thanks really good

  • @huzaifashahid8665
    @huzaifashahid86659 ай бұрын

    Thanks Kunal 🥺

  • @Chakree45
    @Chakree459 ай бұрын

    Hi khushal, it's good you are back again . I request you to post videos of a particular topic in a series , For eg.., You've posted 1st Binary trees after that u posted videos related to string buffer and then 2nd video of binary trees is posted. It may be confusing so please go to next topic once u complete the prev topic. thanks in advance ❤

  • @jk-sm6qr
    @jk-sm6qr4 ай бұрын

    28:27 Hey Kunal, Thank you very much for your hard work. I have a request from you that please make videos on dynamic prog and graphs and complete the playlist. You are brilliant and I want to learn DSA only from you.

  • @workHolic-ne6eo
    @workHolic-ne6eo9 ай бұрын

    Hey Kunal, loved this series. If we are learning DSA from you, who did you learn it from?😉

  • @sanjanachauhan8577
    @sanjanachauhan85779 ай бұрын

    THANKYOU!!!!🙃

  • @ankur07M
    @ankur07M9 ай бұрын

    Thank you Kunal

  • @ankur07M

    @ankur07M

    9 ай бұрын

    Thank you Kunal 👍🏻👍🏻

  • @riyaxgupta
    @riyaxgupta9 ай бұрын

    yayyyyyy, new video

  • @vijaybenz9741
    @vijaybenz97418 ай бұрын

    great content!!1

  • @coolboymohit3200
    @coolboymohit32007 ай бұрын

    thanks kunal

  • @omarrojouleh8592
    @omarrojouleh85929 ай бұрын

    the goat has returned

  • @navadeepkumarreddy2617
    @navadeepkumarreddy26173 ай бұрын

    thanks a lot mam

  • @bankaaaaaaai
    @bankaaaaaaai9 ай бұрын

    Goat is back💥

  • @chiragaggarwal480
    @chiragaggarwal4809 ай бұрын

    I'll definitely visit london to meet you one day...

  • @utkarshagrawal2020
    @utkarshagrawal20208 ай бұрын

    Thankyou sir

  • @LowkeyCoder
    @LowkeyCoder9 ай бұрын

    oh u recoreded this while u were about to go to south america niice.

  • @jk-sm6qr
    @jk-sm6qr4 ай бұрын

    Thanks

  • @FFGAMER-yd1xj
    @FFGAMER-yd1xj9 ай бұрын

    #DSAwithKunal will trend again. 🎉

  • @kartikverma6988
    @kartikverma69889 ай бұрын

    Finally ❤❤❤

  • @sourabhkumar5815
    @sourabhkumar58158 ай бұрын

    Hey @kunalKushwaha , please let me know the book you used for studying DSA. This DSA bootcamp is amazing. wish it could be more consistent in terms of providing lectures. Grateful for your efforts.

  • @kunalmahajan9807
    @kunalmahajan98079 ай бұрын

    wake up babe new kunal kushwaha dsa video just dropped

  • @adityashetty6096
    @adityashetty60969 ай бұрын

    Kunal please finish it , I have high hopes on you 🎉

  • @kumarYash123
    @kumarYash1239 ай бұрын

    I know some basics of c++ progamming upto oops but for dsa i want to code in java To view this playlist do i need to learn basics of java or i just start this playlist . please do reply I am in so much of confusion.

  • @DipakMaliOfficial
    @DipakMaliOfficial9 ай бұрын

    Thank You So Much Bro For Your Amazing DSA Playlist ❤Now, Please make the Graph and DP videos. It will be very grateful to you brother ❤❤

  • @KunalKushwaha

    @KunalKushwaha

    9 ай бұрын

    As soon as possible

  • @raghvendrasingh1981

    @raghvendrasingh1981

    9 ай бұрын

    @@KunalKushwaha what's the next topic? Is Graph & DP only left?

  • @YARRAPATHRUNISHANMUKHAKUMARCSE
    @YARRAPATHRUNISHANMUKHAKUMARCSE9 ай бұрын

    super course

  • @jannatrusiyana2598
    @jannatrusiyana25989 ай бұрын

    Which app do you use to take notes ?

  • @sureshkannan6313
    @sureshkannan63139 ай бұрын

    Yuo're contributing to the society...🌱

  • @ramlanjekar2773
    @ramlanjekar27737 ай бұрын

    faad dala

  • @navnav1819
    @navnav18195 ай бұрын

    Another great video

  • @KunalKushwaha

    @KunalKushwaha

    5 ай бұрын

    Thanks again!

  • @navnav1819

    @navnav1819

    5 ай бұрын

    @@KunalKushwaha No problem :)

  • @ajinxRGB
    @ajinxRGB9 ай бұрын

    Dsa God Kunal OP!!!🎉🎉

Келесі