Introduction to Heap Data Structure + Priority Queue + Heapsort Tutorial

  Рет қаралды 68,519

Kunal Kushwaha

Kunal Kushwaha

Күн бұрын

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
@KunalKushwaha 9 ай бұрын
👉 Resources - Join Replit: join.replit.com/kunal-kushwaha - Lecture code: replit.com/@KunalsReplit/Heaps-1
@poorpanda9033
@poorpanda9033 9 ай бұрын
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 !!
@Jyothirmai1111
@Jyothirmai1111 9 ай бұрын
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.
@HariHaran-oq7wr
@HariHaran-oq7wr 9 ай бұрын
Thalaiva....va thalaiva va thalaiva 🔥
@AtharvaRao0104
@AtharvaRao0104 9 ай бұрын
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
@gojosatoru988
@gojosatoru988 9 ай бұрын
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...
@chiragaggarwal480
@chiragaggarwal480 9 ай бұрын
Thank your so much kunal.... was waiting for youu...!!
@ritanshubirla6714
@ritanshubirla6714 9 ай бұрын
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!
@HB-nw2cb
@HB-nw2cb 9 ай бұрын
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
@kevinkenei4725 9 ай бұрын
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
@trailblazer3465 9 ай бұрын
Thanks Kunal for starting again. Please continue 🙏
@ediscage
@ediscage 7 ай бұрын
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 !!!!
@isaacreyes4915
@isaacreyes4915 8 ай бұрын
Thanks, really appreciate you taking the time to teach us!
@balulucky4457
@balulucky4457 9 ай бұрын
Tqs kunal waiting for ur video bcz No u tube lecture as teach as u ❤❤
@Ashritha_purna
@Ashritha_purna 9 ай бұрын
Thank you so much kunal for the video❤ and super excited for the next questions video.
@VinayKumar-zt1be
@VinayKumar-zt1be 9 ай бұрын
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.
@satestactmathtutor6570
@satestactmathtutor6570 9 ай бұрын
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?
@upendrakumar-bw1jd
@upendrakumar-bw1jd 6 ай бұрын
So many people making it complex but You made heaps really simple.
@soumiksen7445
@soumiksen7445 8 ай бұрын
39:10 to 39:15 , I literally died laughing watching that part 😂😂😂
@pavithas1114
@pavithas1114 27 күн бұрын
Me too
@sharath_29
@sharath_29 9 ай бұрын
Was waiting for this.. finally 🔥🔥🔥🔥🔥
@dineshaher9634
@dineshaher9634 9 ай бұрын
Thank you so much bhaiya for the high quality content❤
@27_sakshijadhav2
@27_sakshijadhav2 9 ай бұрын
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 🙏🙏
@AdityaSharma-it5ue
@AdityaSharma-it5ue 6 ай бұрын
A big Thank you for these awesome videos!
@ABHISHEK-E-VECTOR-jo1pc
@ABHISHEK-E-VECTOR-jo1pc 9 ай бұрын
Awesome video Kunal sir ❤❤
@azadsinghdinkar3951
@azadsinghdinkar3951 21 күн бұрын
Outstanding explanation
@trailblazer555
@trailblazer555 7 ай бұрын
Easily understood..!! Thanks Kunal...
@user-oz3hc6lj2e
@user-oz3hc6lj2e 8 ай бұрын
I am really grateful to you for creating this video
@sakshamjoshi1118
@sakshamjoshi1118 9 ай бұрын
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
@suravipanigrahi8507
@suravipanigrahi8507 9 ай бұрын
Great stuff clear the concept in one short
@NeerajSingh-mc5kf
@NeerajSingh-mc5kf 2 ай бұрын
I enjoyed watching this complete videos Great work Kunal
@LavKushwaha
@LavKushwaha 9 ай бұрын
Finally, king is back with his new super duper video.❤️‍🔥🔥 Thank you for providing such an amazing DSA course for free on KZfaq. 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
@kavierjogie6694
@kavierjogie6694 9 ай бұрын
Thanks Kunal, Your videos are really helpful.
@TanushkaKashyap-cf7sd
@TanushkaKashyap-cf7sd 22 күн бұрын
You doing a great job K!
@nikolatesla399
@nikolatesla399 7 ай бұрын
One of the best video on heaps ..❤
@its_shivam_jha
@its_shivam_jha 9 ай бұрын
I haven't reached this video yet . But thank you for continuing the playlist.
@vikrant9272
@vikrant9272 9 ай бұрын
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
@curiousmanash8154
@curiousmanash8154 9 ай бұрын
Just explanation is in motion . loved it❤
@tushargoswami6622
@tushargoswami6622 9 ай бұрын
Thank you Kunal 🤝
@prettylilnerdy6802
@prettylilnerdy6802 7 ай бұрын
I would even pay for this course such great way of teaching. And please go ahead with DP
@Doremonspocket
@Doremonspocket 4 ай бұрын
You made it simple!
@amazingvideos5398
@amazingvideos5398 9 ай бұрын
this video deserves q10000+ cmnts why only 172 ? hats off to you kunal
@abhinavmathur6072
@abhinavmathur6072 9 ай бұрын
thank you bro ❤️Great work you are doing ✌🏻👀 will comment after watching :)
@sachinsingh6244
@sachinsingh6244 9 ай бұрын
THAT'COOL KUNAL , Waiting for the Next
@vaibhavimishra763
@vaibhavimishra763 9 ай бұрын
God bless u❤ , really great great work sir, no one can provide such an awesome course, pls sir provide remaining topics also
@sasikanth8378
@sasikanth8378 7 ай бұрын
no can provide this high quality teaching
@sathwikyadalam
@sathwikyadalam 9 ай бұрын
Great Course Kunal!
@elco7956
@elco7956 9 ай бұрын
Long awaited
@vasudevsurwase9660
@vasudevsurwase9660 8 ай бұрын
This series is amazing ,and also really helping while going to the iinterview . please upload graph videvos
@sravansunkara9145
@sravansunkara9145 9 ай бұрын
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
@nikhil7947
@nikhil7947 9 ай бұрын
Great bro keep it up❤
@jayvyas9700
@jayvyas9700 2 ай бұрын
Thanks really good
@sysybaba420
@sysybaba420 6 ай бұрын
"Java doesn't have pointers so you get my point" framing this!
@Siddharthsirsate77
@Siddharthsirsate77 9 ай бұрын
Keep them coming
@rashisahu9587
@rashisahu9587 9 ай бұрын
Superb video
@jaymahakaal5354
@jaymahakaal5354 9 ай бұрын
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🙌❤
@rishipatel4553
@rishipatel4553 8 ай бұрын
thanks bhaiya..
@joejangala
@joejangala 9 ай бұрын
Playlist is getting better and better.....
@Adityasingh-tq4nt
@Adityasingh-tq4nt 9 ай бұрын
Good work 👍
@ranjitgalande2388
@ranjitgalande2388 9 ай бұрын
best course on KZfaq
@chaman3679
@chaman3679 6 ай бұрын
huge respect to you 🙏
@coolboymohit3200
@coolboymohit3200 7 ай бұрын
thanks kunal
@mahendrakolhe6263
@mahendrakolhe6263 9 ай бұрын
Thanks Kunal ❤
@_PoojaDahifale
@_PoojaDahifale 9 ай бұрын
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
@mahirr8090
@mahirr8090 9 ай бұрын
Thanks kunal ❤️
@Zunan263
@Zunan263 9 ай бұрын
Kindly keep posting
@jk-sm6qr
@jk-sm6qr 4 ай бұрын
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.
@sahebraojadhav9727
@sahebraojadhav9727 9 ай бұрын
Thank you @kunal
@pramithasdhakal5367
@pramithasdhakal5367 9 ай бұрын
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.
@adeel47896
@adeel47896 7 ай бұрын
What a Man, no word to say
@navadeepkumarreddy2617
@navadeepkumarreddy2617 3 ай бұрын
thanks a lot mam
@shetysify
@shetysify 9 ай бұрын
Legend is back !!
@Adonis08
@Adonis08 9 ай бұрын
the best video🔥🔥🔥🔥
@ujjwalshrivastava-xs5lx
@ujjwalshrivastava-xs5lx 9 ай бұрын
Thank you❤
@HARI-iy5uv
@HARI-iy5uv 9 ай бұрын
Back on track 💥
@workHolic-ne6eo
@workHolic-ne6eo 9 ай бұрын
Hey Kunal, loved this series. If we are learning DSA from you, who did you learn it from?😉
@jk-sm6qr
@jk-sm6qr 3 ай бұрын
Thanks
@huzaifashahid8665
@huzaifashahid8665 9 ай бұрын
Thanks Kunal 🥺
@sanjanachauhan8577
@sanjanachauhan8577 9 ай бұрын
THANKYOU!!!!🙃
@vijaybenz9741
@vijaybenz9741 8 ай бұрын
great content!!1
@Chakree45
@Chakree45 9 ай бұрын
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 ❤
@omarrojouleh8592
@omarrojouleh8592 9 ай бұрын
the goat has returned
@bankaaaaaaai
@bankaaaaaaai 9 ай бұрын
Goat is back💥
@nishantverma194
@nishantverma194 7 ай бұрын
perfect
@riyaxgupta
@riyaxgupta 9 ай бұрын
yayyyyyy, new video
@FFGAMER-yd1xj
@FFGAMER-yd1xj 9 ай бұрын
#DSAwithKunal will trend again. 🎉
@utkarshagrawal2020
@utkarshagrawal2020 8 ай бұрын
Thankyou sir
@chiragaggarwal480
@chiragaggarwal480 9 ай бұрын
I'll definitely visit london to meet you one day...
@DipakMaliOfficial
@DipakMaliOfficial 9 ай бұрын
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?
@LowkeyCoder
@LowkeyCoder 9 ай бұрын
oh u recoreded this while u were about to go to south america niice.
@muhammadabuzar7910
@muhammadabuzar7910 8 ай бұрын
thank u thank u
@ankur07M
@ankur07M 9 ай бұрын
Thank you Kunal
@ankur07M
@ankur07M 9 ай бұрын
Thank you Kunal 👍🏻👍🏻
@navnav1819
@navnav1819 5 ай бұрын
Another great video
@KunalKushwaha
@KunalKushwaha 5 ай бұрын
Thanks again!
@navnav1819
@navnav1819 5 ай бұрын
@@KunalKushwaha No problem :)
@sourabhkumar5815
@sourabhkumar5815 8 ай бұрын
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.
@kumarYash123
@kumarYash123 9 ай бұрын
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.
@kartikverma6988
@kartikverma6988 9 ай бұрын
Finally ❤❤❤
@YARRAPATHRUNISHANMUKHAKUMARCSE
@YARRAPATHRUNISHANMUKHAKUMARCSE 9 ай бұрын
super course
@adityashetty6096
@adityashetty6096 9 ай бұрын
Kunal please finish it , I have high hopes on you 🎉
@Isagi__000
@Isagi__000 9 ай бұрын
I was just watching your other videos. Thank you for what you are doing. Is there any way to reach you out for like 10 or 20 min kinda like mentor.. Session i mean in future. Any way keep doing. All the best
@ramlanjekar2773
@ramlanjekar2773 7 ай бұрын
faad dala
@kunalmahajan9807
@kunalmahajan9807 9 ай бұрын
wake up babe new kunal kushwaha dsa video just dropped
Introduction to HashMap & HashTable in Java
1:39:46
Kunal Kushwaha
Рет қаралды 76 М.
Data Structures Explained for Beginners - How I Wish I was Taught
17:06
Internet Made Coder
Рет қаралды 552 М.
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 140 МЛН
Русалка
01:00
История одного вокалиста
Рет қаралды 5 МЛН
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 97 МЛН
2.6.3 Heap - Heap Sort - Heapify - Priority Queues
51:08
Abdul Bari
Рет қаралды 2 МЛН
Solve Any Pattern Question Very Easy Trick  !
6:23
thefourhourtalk
Рет қаралды 697
Backtracking Introduction + Maze Problems - Theory + Code + Tips
1:28:10
Kunal Kushwaha
Рет қаралды 178 М.
Priority Queue Explained | Min and Max Heap | Custom Comparator
23:19
Daily Code Buffer
Рет қаралды 18 М.
Heaps in 6 minutes - Methods
5:56
Michael Sambol
Рет қаралды 67 М.
Introduction to Arrays and ArrayList in Java
1:45:53
Kunal Kushwaha
Рет қаралды 1,1 МЛН
Battery  low 🔋 🪫
0:10
dednahype
Рет қаралды 1,3 МЛН
НЕ ПОКУПАЙ СМАРТФОН, ПОКА НЕ УЗНАЕШЬ ЭТО! Не ошибись с выбором…
15:23
Опыт использования Мини ПК от TECNO
1:00
Андронет
Рет қаралды 772 М.