Welcome to my Java Quick Sort tutorial! In most situations the Quick Sort is the fastest sorting algorithm.
In essence, the quick sort works by partitioning arrays so that the smaller numbers are on the left and the larger are on the right. I’ll cover what partitioning is in this video.
The Quick Sort then recursively sends small parts of larger arrays to itself and partitions again. Between the code and the video below you will completely get it in the end.
If you like videos like this, it helps to tell Google+ [googleplusone]
Code from the Video
Partitioning.java
QuickSort.java
Hi, Derek!
Your tutorials are always awesome! Thank you very much for all!
Do you have any tutorial about Test-Driven Development? About mocks objects? If you have, let me know, please. I’m sure that your opinion about that will help me (and other programmers too)…
Regards,
Helton
Thank you very much 🙂 I’ll be covering that topic soon. I’ll cover everything about java by the end
Good Job Derek …….. i,m desperately waiting for Android Tutorials. 🙂
They will start this month finally! Sorry about the wait
Derek,
Great job. Thanks for sharing all of your hard work.
Thank you and you are very welcome 🙂
Having a ‘Partitioning’ object named partitionArray, when you already have a method named partitionArray was confusing and led to this code on line 020:
partitionArray.partitionArray(35);
Sorry about that. That was a mistake
Just a little tip. In your source in the constructor you have call to generateRandomArray, and the same call in the main method…
By helping people learn things that matter to them, you are making this world a better place.
I am also a fan of your presentation style, nice and lucid.
I never understood sorting untill I found your youtube channel.
Thanks
Thank you very much for the kind compliments 🙂 I’m very happy I was able to help.
Hi Derek, I am a great fan of yours and learn a lot from your videos. I refer back to your videos whenever I have any doubt. Just like that I happened to watch this Quick Sort tutorial and I saw how you said that you would learn by printing out stuff. That is what even I do while writing programs and I think it is a great way to have a peek at what is going on in your code. I want to be an intensive programmer like you some day. How do you get yourself going day after day doing so many hundreds of videos?
Hi Viswanth,
Thank you 🙂 Yes that was a trick I developed over time. As per what motivates me, I guess I just really enjoy what I do. I think the reason why I get so much done is because I stick to a very tight schedule. If I schedule something between 1 PM and 3 PM, when 3 PM comes I immediately stop and move on to the next task on the schedule. I also know that I’ll get bored if I do something for to long. Everything for me is a matter of knowing myself. If I know I can perform best at a task if I do it for just 2 hours a day I do that. I know this isn’t always possible when you work for some one, but I’ve always done my best to make it work.
I hope that helps 🙂
Derek
I like your presentation style and definitely your videos gave me the algorithms boost i needed to be back on track 🙂
I’m very happy that I could help 🙂