Quick Sort Using Recursion (Theory + Complexity + Code)

preview_player
Показать описание
In this video, we cover the quick sort algorithm. Including the theory, code implementation using recursion, space and time complexity analysis, along with comparison with merge sort. We also see how in-built sorting algorithms work.

Take part in the learning in public initiative! Share your learnings on LinkedIn and Twitter with #DSAwithKunal & don't forget to tag us!

👉 Resources

=========================================
Timestamps:
00:00 Introduction
03:01 What is Pivot?
04:43 Recursive Quick Sort
09:58 How to put pivot at correct position?
17:55 How to pick the pivot?
20:15 Complexity comparison of pivot positions
27:45 Important Notes
29:32 Hybrid Sorting Algorithms
31:49 Code for Quick Sort
39:12 Internal Sorting Algorithm
41:20 Outro

#sorting #placement #dsa #interviews
Рекомендации по теме
Комментарии
Автор

This is the best JAVA course out here! watching this in 2025 this is still better than many paid courses. Anyone watching this in please believe when he is saying that this course is better than many paid courses out there!

Sahil-smre
Автор

One of the best explanations I've seen for Quick Sort. The way he broke the concept down to its nuts and bolts is really amazing.

hc-dc
Автор

I remember plucking out my hair on recursion and sorting algos before stumbling on your videos. You explain it very well and its very intellectually satisfying to watch your videos as well.

Tomharry
Автор

There's this merge sort and quick sort, people say its hard to understand this and so I left them and proceeded further in my DS journey. But I was damn sure you will make it easy and so listened to you and Now I know this . Thankyou KK Bhaiya 🤩

nishantsingh
Автор

Kunal Kushwaha : "Your start is low, Your End is going to be high" :)

SochtaHoonMain
Автор

I have tried to understand merge sort and quick sort literally a thousand times. In college, classes, some time by me.
I was not able to visualize how it is actually working with recursion, although I knew the code.
But the way, you are simplifying the things and the way you have had the first recursion video done is just awesome.

That first recursion video is quite important and on top of this you explained this sorting so well, kudos man!

sagarmore
Автор

Such a blessing to learn DSA with your videos.😇 Please complete the series.🙂

Sillysmiles
Автор

The confidence you have in your work, is empowering!! Keep that going

zainabfahim
Автор

best lecture on yt for quick sort because it is the most efficient i have seen, but first watch the quick sort algorithm by striver, he will clear all the doubts if you have got any by watching this lecture, since i had lot of doubts . Once you understand the algorithm u can follow the code here .
The concept will be crystal clear then .

AshishKumar-ysrj
Автор

Hey Kunal, your lectures are valuably explained, and covers everything one should know sooner or later.
For example after watching this QuickSort lecture, all I've to do is practice some question, I don't need to watch any more concept of this anywhere, and this is amazing. You and your video lectures are underrated, if this quality of lectures are provided by any EdTech they would have charged that course extravagant.
Hope I'll be able to get ₹7Lakh/month 😂(Joking).

mk_ahmar
Автор

I can't even express how much value it is providing us...hats off kunal bhai!

rohitchilhorkar
Автор

this is good...i mean its good that you didnt advertise your videos in a humble way, because people wont know how good your videos are. PS i didnt realise how fast time went, the way you taught was very smooth and seemed like a story to me.

karthikpm
Автор

Before watching this vid, i was on gfg and javapoint understanding what quick sort was and my god, kunal has explined it so well and he hasnt copied what they did and I was blown by how easy he has made this!! Kudos bro,

tejasvijain
Автор

Kunal is very quick now 🔥
Thanks for the course ❣️

VinodKumar-fniq
Автор

Thank you Kunal Sir. You are always the best teacher. I never learned this sort by fearing the complexity. But now you made it a cakewalk. Always grateful.

shantahiremath
Автор

Please Use Black Background for writing on the screen
It doesn't affect eyes much 😊😊
Consider this Man

vinaykrishna
Автор

i request you to please upload all the remaining topics of this complete DSA bootcamp as soon as possible

nishu
Автор

The way you have explained is great Kunal!

vidhijain
Автор

Thanks for teaching us like no one did till now!! One small request, please make lectures on dynamic programming as well!!

Helly_Patel
Автор

An alternative approach is to swap the pivot with the last index before we start in each recursive call and then start comparing left and right. Once index cross over, we swap pivot with left pointer. Works out much cleaner at code level.

anshulgoel
welcome to shbcf.ru