Quick Sort Algorithm | How Quick Sort Works (Example Diagram) | Part - 1 | Sorting Algorithms - DSA

  Рет қаралды 63,825

Simple Snippets

4 жыл бұрын

Support Simple Snippets by Donations -
Google Pay UPI ID - tanmaysakpal11@okicici
PayPal - paypal.me/tanmaysakpal11
--------------------------------------------------------------------------------------------- In this DSA tutorial, we will understand the working of Quick Sort Algorithm with the help of a visual diagram. We will dry run the entire quick sort sorting algorithm to understand its working.
QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot.
There are many different versions of quickSort that pick pivot in different ways.
1. Always pick first element as pivot.
2. Always pick last element as pivot (implemented in this video)
3. Pick a random element as pivot.
4. Pick median as pivot.
The key process in quickSort is partition().
In the Partitioning process, we perform In-Place sorting on the same array/list in such a way that, all the elements smaller than the pivot element are shifted to the left of the pivot element & all the elements that are larger than the pivot element are shifted to the right of the pivot element.
Full DSA playlist - kzfaq.info/get/bejne/jqmpqKuEr7mbiHk.html
Full Code & Theory article - simplesnippets.tech/quick-sort-algorithm-with-example-with-cpp-code-data-structures-algorithms/
C++ Programming Tutorials for Beginners Course - kzfaq.info/get/bejne/d7F-espyvbrFop8.html
Simple Snippets Official Website -
simplesnippets.tech/
Simple Snippets on Facebook -
simplesnippets/
Simple Snippets on Instagram -
simplesnippets
Simple Snippets on Twitter -
simplesnippet
Simple Snippets Google Plus Page -
plus.google.com/+SimpleSnippets
Simple Snippets email ID -
simplesnippetsinfo@gmail.com
For More Technology News, Latest Updates and Blog articles visit our Official Website - simplesnippets.tech/
#quicksort #sortingalgorithms #datastructures #algorithms

Пікірлер: 156
@riyadhossain1706
@riyadhossain1706 Жыл бұрын
I really appreciate the effort you have done. Even after 3 years, your tutorials are still worthy.
@mansigoyal3440
@mansigoyal3440 4 жыл бұрын
This channel should be first recommendation on youtube for DSA
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Hehehe thanks Mansi, you have always been very supportive 🙏
@sushilingole8448
@sushilingole8448 3 жыл бұрын
Indeed
@jaiminrathwa6393
@jaiminrathwa6393 3 жыл бұрын
true 👍👍👍👍
@sourabh1483
@sourabh1483 2 жыл бұрын
This is the best quick sort video i found on youtube.
@ahmadbilal9363
@ahmadbilal9363 3 жыл бұрын
The fact that you only get a handful of views and still you are making tutorials for that audience makes me your fan more than a student. Thanks Sir❤ Love and respect from Pakistan❤
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Thanks Ahmad, really glad to read such wonderful comment from you. And yes I will keep making tech ed content for everyone for free 🙂 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
@pradhumansingh3933
@pradhumansingh3933 Жыл бұрын
Thank u for clearing all my doubts...Detailing at its best👍👍
@CricketLover-kc6ln
@CricketLover-kc6ln 3 жыл бұрын
Best Content For DSA .Don't Understand Why This Channel Is So Underrated 😯 Anyways Keep It Up Sir 💪
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Thank you so much buddy. Glad to know this!
@NetajiSaiSuru
@NetajiSaiSuru Жыл бұрын
Very Detailed Explanation Thank you so much ❤
@brandonlind5700
@brandonlind5700 Жыл бұрын
great video! Took a complex concept and made it simple to understand
@freenox1797
@freenox1797 7 ай бұрын
Masha'Aallah, That's literally perfect explanation, thank you.
@emmanuelsanchez7662
@emmanuelsanchez7662 4 жыл бұрын
Top in-depth video I’ve seen in DSA. Definitely looking forward to see more! Thanks!!
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Awesome, thank you!
@anilkumarambati3729
@anilkumarambati3729 Жыл бұрын
You have made it seem very easy with your explanation...kudos to your efforts... keep continuing your good work brother 💗
@zanderclaassen9472
@zanderclaassen9472 4 жыл бұрын
mate you explain stuff so well, I like the fact that you break stuff down step by step, great video's..best I've seen so far
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
I appreciate that! Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
@vedantbhugul5264
@vedantbhugul5264 3 жыл бұрын
great explanation "HATS OFF TO YOU SIR ".
@weijunhuang8306
@weijunhuang8306 Жыл бұрын
really detail explaination step by step, appreciate the work
@talhahassan724
@talhahassan724 6 ай бұрын
Sir your dry run is just absoulety amazing. Amazing content . I understand every bit of it. Thank you
@naviyas2305
@naviyas2305 2 жыл бұрын
thanks alot bro..you're the best
@improveyourknowledge6590
@improveyourknowledge6590 Жыл бұрын
your explanation is awesome!
@gugasamukashvili4947
@gugasamukashvili4947 3 жыл бұрын
your vids help me so much,
@samarthtandale9121
@samarthtandale9121 2 жыл бұрын
Extremely easy to understand and excellent video! You are literally saving lives🔥🙌🏼❤️👍🏼
@bhavansbhavans9299
@bhavansbhavans9299 2 жыл бұрын
Super easy !!! Only because of your explanation
@veenaas4837
@veenaas4837 2 жыл бұрын
Explanation is very good, easily understandable.
@AhmedAdel-xg1cm
@AhmedAdel-xg1cm 3 жыл бұрын
the way of ur explanation is beyond imagination, thank u soooooooo mush u make complex things very very easy :)
@saranyav2867
@saranyav2867 Жыл бұрын
Really amazing explanation
@harshalsangame1305
@harshalsangame1305 2 жыл бұрын
I liked this video and now Likes become 1000, thank you
@francesco4433
@francesco4433 Жыл бұрын
thank you very much that was helpful. god bless you
@gurmansingh1878
@gurmansingh1878 2 жыл бұрын
Hats off to you sir..... Great Explanation
@albertdavidbangura7271
@albertdavidbangura7271 2 жыл бұрын
You are great sir! Thank you.
@rathoddharmik610
@rathoddharmik610 2 жыл бұрын
such e great explanation 🙂🙂thanks brother.
@masumali8356
@masumali8356 Жыл бұрын
You are the best.....masum
@rushikeshthombre7533
@rushikeshthombre7533 3 жыл бұрын
Bro I haven taken course at upgrad I does not understand there But when I see your video I get perfect understanding Bro take session on interview questions for entry level It will also get positive impact
@mohamedbimasmaren6671
@mohamedbimasmaren6671 2 жыл бұрын
you just helped me ! thnx .
@feelimages
@feelimages 2 жыл бұрын
Thank you so much.. Your Dry Run was so easy to understand.. 🙌🏻 🤜🏻
@anshipatel9703
@anshipatel9703 2 жыл бұрын
After watching one video I'm here to watch the whole playlist👍👍❤
@SimpleSnippets
@SimpleSnippets 2 жыл бұрын
Welcome to Simple Snippets 🤘🙌❤️
@Yunyopern
@Yunyopern 2 жыл бұрын
Great teachings my friend keep it up
@goktugkoksal8643
@goktugkoksal8643 3 жыл бұрын
Thats what I was searching for
@peareaml1782
@peareaml1782 3 ай бұрын
Clear explanation and nice work though! Thank you!
@pvj7398
@pvj7398 2 жыл бұрын
Very nice explaination brother...
@shaharrefaelshoshany9442
@shaharrefaelshoshany9442 2 жыл бұрын
you are the best ever
@ManishSharma-fi2vr
@ManishSharma-fi2vr Жыл бұрын
Thank You!
@bikramchettri9405
@bikramchettri9405 3 жыл бұрын
Awesome content!
@israrqayyum7
@israrqayyum7 6 ай бұрын
Thanks sir ❤
@shahzarnesar696
@shahzarnesar696 2 жыл бұрын
Thank you so much!!!!
@074vinaysuyal3
@074vinaysuyal3 3 жыл бұрын
Thank you, really helpful
@Hizzus
@Hizzus 2 жыл бұрын
awesome thanks alot !
@kumkumjain7588
@kumkumjain7588 2 жыл бұрын
best explanation 😊
@irfankhan7822
@irfankhan7822 2 жыл бұрын
well explained
@shanmugamayanm7430
@shanmugamayanm7430 9 ай бұрын
your explanation is god level bro.. Thank you so much❤❤❤❤
@SimpleSnippets
@SimpleSnippets 9 ай бұрын
So nice of you :-)
@sujithk9811
@sujithk9811 3 жыл бұрын
Excellent explanation💯
@rashisingh5994
@rashisingh5994 3 жыл бұрын
So helpful! 🔥
@anshmishra9079
@anshmishra9079 3 жыл бұрын
Bro I am very glad that I got your video suggestion for this quick sort, I was like searching here and there but didn't got any perfect explanation.... But perfection defines YOU...... 🌈🙏 Great man, please keep it up.
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Glad to hear that Ansh! please support me by sharing our videos and channel with your friends!
@AbdulxamidFayziev
@AbdulxamidFayziev Жыл бұрын
you should run for loop till 4 " I < end "
@user-bu8mg7uq3s
@user-bu8mg7uq3s 2 жыл бұрын
thaank you so much
@giggleglyphs
@giggleglyphs 3 жыл бұрын
I could not stop myself commenting on your every video because I feel grateful to you when i understand a concept :)))
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Hehe all your comments are highly appreciated and welcomed 😊🤘 I'm glad that these videos are making you understand the DSA concepts. I request you to please keep sharing them with your friends and batchmates ✌️
@giggleglyphs
@giggleglyphs 3 жыл бұрын
@@SimpleSnippets I have already shared this playlist with all my friends😹
@sushilingole8448
@sushilingole8448 3 жыл бұрын
Very deep explanation, what I usually need, you caught my attention bro, awesome work... 👍
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Glad it was helpful! Thank you so much buddy. It would mean a lot if you could please share our channel and videos with your friends too ✌
@hemamatli8726
@hemamatli8726 4 жыл бұрын
Super explanation plzzz make more videos
@vinit1366
@vinit1366 3 жыл бұрын
Great Video ❤️
@ansariaasif9596
@ansariaasif9596 2 жыл бұрын
thanks sir
@nabinpanthi5434
@nabinpanthi5434 2 жыл бұрын
never seen anyone explaining like this. cout
@SimpleSnippets
@SimpleSnippets 2 жыл бұрын
I'm glad you liked it. cout
@dushyantjakhar1716
@dushyantjakhar1716 2 жыл бұрын
bro i love you you teaching skills are in top on whole internet
@dushyantjakhar1716
@dushyantjakhar1716 2 жыл бұрын
I watched also expert and its nothing in front of you
@abinaya7704
@abinaya7704 3 жыл бұрын
wow I recommended ur channel to many ppl..Such an awesome channel for learning programming concepts..Hats off bro
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Awesome, thank you!
@dishanamdev2620
@dishanamdev2620 4 жыл бұрын
Speechless explanation👏 Thanku very much. Really you put so much efforts in explaining... It's like stupendofantabulousfantastic🙌
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Thank you so much Disha for such a wonderful comment😀 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
@sharifullahdanish4480
@sharifullahdanish4480 2 жыл бұрын
thank you for the effort to show us the entire working of the quick sort, one question is: Does the quick sort algorithm and code varies for the odd and even values of the given array to be sorted? on my opinion, yes, it does vary for the odd & even values but can't make any equation for it...
@user-bu8mg7uq3s
@user-bu8mg7uq3s 2 жыл бұрын
you are amazing
@MadMax-pk8ss
@MadMax-pk8ss Жыл бұрын
Another great video! I think fully utilizing the available technology that is out there would really enhance your presentations. The detail in explaining concepts is among the best, however, as you mentioned in the video yourself, at times the visual presentation is quite messy. I feel this could be greatly improved by experimenting with different educational software tools and techniques.
@Kidpunk98
@Kidpunk98 3 жыл бұрын
What a legend, wow.
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Thanks buddy 😊🤘
@tushar.musique
@tushar.musique 3 жыл бұрын
Thank you sir!, Really Really helpful.
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Most welcome!
@gopavaramsaimadhuree520
@gopavaramsaimadhuree520 4 жыл бұрын
very good explanation. very easy to understand 👌👍
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Thank you so much buddy🙏 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
@vaishnavibangar7423
@vaishnavibangar7423 2 жыл бұрын
cannot get rid of ross yelling PIVOTT PIVOTTTT while watching this xD
@rachanasr7547
@rachanasr7547 3 жыл бұрын
Excellently explained 😎
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Glad it was helpful!
@abrarvlogs6931
@abrarvlogs6931 2 жыл бұрын
Legend ❤
@maryta22
@maryta22 3 жыл бұрын
Thanks! :)
@asgaming-ns2qn
@asgaming-ns2qn 3 жыл бұрын
Bro tanmay your explanation is so good, We understand the entire algo just with the first pass of dry run. my mind say lets code it but yet watching completely for accuracy : )
@aishu812
@aishu812 2 жыл бұрын
I fall in love with ur channel 💓....u r making the root strong...that is what needed in dsa
@SimpleSnippets
@SimpleSnippets 2 жыл бұрын
Thank you so much😊 very happy to read this feedback from you. Please keep sharing✌️
@aishu812
@aishu812 2 жыл бұрын
@@SimpleSnippets sure
@shailajareddy1423
@shailajareddy1423 4 жыл бұрын
simplified and good explanation...
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Glad you liked it ✌ Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
@tahirmahmood1721
@tahirmahmood1721 4 жыл бұрын
@@SimpleSnippets Describe precisely the pivot step of QuickSort, using the median-of-three method for pivot selection, and show every stage of the rst pivot step applied to the array with the following entries: 3; 4; 7; 1; 2; 6; 5
@keerthig8139
@keerthig8139 2 жыл бұрын
Can we write quick sort in terative call.? Is it possible.?
@nagendrapp2213
@nagendrapp2213 4 жыл бұрын
Nice keep upload more videos as soon as possible
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Yes buddy, try to put out as much content as possible. Please do share the videos with your friends too & definitely subscribe ✌
@gokulnaathb2627
@gokulnaathb2627 2 жыл бұрын
It was so good, the best
@SimpleSnippets
@SimpleSnippets 2 жыл бұрын
I'm glad you liked it ✌️ please do share it with your friends too 😊
@whatdoiputhere5089
@whatdoiputhere5089 2 жыл бұрын
dude, you video should be on top when searching for quick sort. I dont understand how the youtube algorithm is not putting this video at the top
@SimpleSnippets
@SimpleSnippets 2 жыл бұрын
Yeah even I don't understand how it works but I think it's more on users who watch it and like & comment then on me. Hopefully it'll go up on the ranking 🙌😊
@swarajchoudhary1862
@swarajchoudhary1862 3 жыл бұрын
20:41 -> 3 and 9 will swap each other as pindex is previously increased from 0 to 1
@behindthescene4406
@behindthescene4406 2 жыл бұрын
First swapping is done then index got incremented therefore 7 and 3 got swapped
@ankursingh-ej1wi
@ankursingh-ej1wi 2 жыл бұрын
Best explanation sir
@ankursingh-ej1wi
@ankursingh-ej1wi 2 жыл бұрын
Sir if possible pls make a series of coding interview problems
@SimpleSnippets
@SimpleSnippets 2 жыл бұрын
Yeah I plan to do that after DSA playlist
@anchalpandey2787
@anchalpandey2787 3 жыл бұрын
thanks for the video
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
You're welcome
@DreamQuestGamer
@DreamQuestGamer 3 жыл бұрын
Quicksort is an in-place sorting algorithm,it is ok. but we can make merge sort also an in-place algorithm, which means without taking another temporary array we can sort an array using mergeSort algo. correct me if I am wrong.
@manaspatil4316
@manaspatil4316 3 жыл бұрын
plz make video on Graph data structure ... and also on file organization ..these are the only topics remained in DSA .....& BTW Huge salute to you for all uploaded videos..Love from DHULE,Maharashtra !!!
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
As soon as possible
@maryammahtab7886
@maryammahtab7886 3 жыл бұрын
This video make the algoritm very easy
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Thanks buddy! Please do share the videos and our channel with your friends if you want to genuinely support me & our channel!✌😇
@maryammahtab7886
@maryammahtab7886 3 жыл бұрын
I’m facing a little error in that and unable to fix . Can u plz help me?
@bodlahruthik5730
@bodlahruthik5730 4 жыл бұрын
@Simple Snippets , sir definition of time comlexity itself says that it it the mathematical type of expression to show time consumption of that algorithm at its worst case,then why there are time complexitites for best performances ,average performances, and worst performances .
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Thats because in some cases, the time complexities of best case, avg case and worst case follow different mathematical expression.
@bodlahruthik5730
@bodlahruthik5730 3 жыл бұрын
@@SimpleSnippetsoh thank u sir
@kandikantikarthikeyagoud1689
@kandikantikarthikeyagoud1689 3 жыл бұрын
good explanation bro
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Glad you liked it
@bhavyaaggarwal8558
@bhavyaaggarwal8558 3 жыл бұрын
plz make a video on randomized quick sort also
@LeAndre_deCorrypeuxdiz
@LeAndre_deCorrypeuxdiz 2 жыл бұрын
you are the best understanding from all the others channel algorithms when i win lottojackpot euromillions i send you 30000eur
@SimpleSnippets
@SimpleSnippets 2 жыл бұрын
Thank you so much Andre ✌️ hope you win the lotto jackpot very soon 😂🤘
@harishgehlot__
@harishgehlot__ 3 жыл бұрын
Hii me harish,will you explain heap sort please
@feelimages
@feelimages 2 жыл бұрын
Subbed and Belled..😊
@pranavireddy3035
@pranavireddy3035 3 жыл бұрын
Please add heap sort video also
@Nseconds
@Nseconds 4 жыл бұрын
Good
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Thank you 😇
@prateekgautam37
@prateekgautam37 4 жыл бұрын
bht accha padhte ho sir opps ka thoda sa videos shi se smjhna hai
@sakshisinghal1669
@sakshisinghal1669 3 жыл бұрын
why the space complexity is O(log n) in case of quick sort?
@knightspygaming1287
@knightspygaming1287 2 жыл бұрын
It uses less space which is advantage over other sorting techniques..
@santhoshm.r.s2383
@santhoshm.r.s2383 Жыл бұрын
Why quick sort is getting very slow when a list of elements more than 10000 is passed? ,I thought it was due to recursion but merge sort on other hand uses recursion but sorts the list(elements>10000) 4times faster than quick sort (quick sort took 45+ min ,but merge sort took 8 to 9 sec) Can u please explain why this happens ,even if both uses similar kind of approach and methods
@amitpaunikar3408
@amitpaunikar3408 4 жыл бұрын
Nice explanation....missing heap sort Algorithm...searched but not got in ur playlist
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
After we understand heap data structure ✌️ starting with Non linear DS soon. Stay tuned 😁
@amitpaunikar3408
@amitpaunikar3408 4 жыл бұрын
@@SimpleSnippets will wait for heap sort video bcoz no good video in KZfaq as after watching ur video no need to watch other videos ....still lot of video remaining to see from ur playlist...ur doing great job bro...u have very good knowledge... keep it up.
@pranayhusukale2666
@pranayhusukale2666 4 жыл бұрын
Plz make more videos on DSA
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Yes pranay, many more coming up soon ✌
@ashutoshsahoo8076
@ashutoshsahoo8076 3 жыл бұрын
tanmay sakpal == GOD
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Haha thank you 😅
@ashutoshsahoo8076
@ashutoshsahoo8076 3 жыл бұрын
Bro u should create a telegram channel so that we can connect with u and get updates about ur upcoming videos(just a suggestion 😅)
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Yeah I've been thinking about it since long time. Maybe a discord server might work too. However I don't think I'll be able to actively manage it that well. Let's see ✌️
@-VISHWAJEET_CHAVAN
@-VISHWAJEET_CHAVAN 2 жыл бұрын
why no intro music and animatiob
@toplanezerionly1819
@toplanezerionly1819 3 жыл бұрын
YOU ARE A FKING GOD BRO THANK YOU SO MUCHHH!!!
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 4,9 МЛН
Children deceived dad #comedy
00:19
yuzvikii_family
Рет қаралды 8 МЛН
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 4,9 МЛН