Of all the videos I watched on youtube for quick sort, I understood this one a lot better in a much more intuitive way.
@1Lia117 ай бұрын
i've been searching for hours for a video that could explain exactly what happens when there is only 2 elements, and i finally got it! thanks a lot
@MaleeshaHuththo3 жыл бұрын
this entire playlist saved me great deal of time. thank you very much!
@sweetiepiedpiperr5 ай бұрын
I can't like this video enough!!! Danke schön! You explain so well -- I've finally understood Quicksort!
@stumbleio11 ай бұрын
Best explanation on KZbin. You should continue making these types of videos. You do such a great job at it!
@DanielSmith-uj7rr3 жыл бұрын
Very best explanation of the quick sort. Thank you. Please ignore the Dislikes and Keep it up bro. You did an amazing job to clear the understanding of this algorithm. Thank you again!
@SourabhGurav-s4o26 күн бұрын
Thanks Felix. The explanation was slow and intuitive. Understood every bit of what you explained.
@binkarimov421810 ай бұрын
Bro you gave me full understanding of quick sort! Thank you! Please continue to make such videos with other sortings in Python!
@ganeshreddykomitireddy5128 Жыл бұрын
one of the finest explanations found on youtube.
@alaaseada46592 ай бұрын
Thanks a million for making this algorithm easy to understand.
@henryconner7807 ай бұрын
Thanks bro, really great visual. You saved me a lot of time
@LukeAvedon Жыл бұрын
LOVE THE SWAP ANIMATION!
@polimorphic132 жыл бұрын
The graphic explanation is perfect.
@liabasqulizad79629 ай бұрын
Thank you sir. That was very good explanation.
@narayanadhurti16036 ай бұрын
This is indeed a great explanation.Thanks a ton.
@syydsalman3 жыл бұрын
Masha"Allah Felix, This took me a day to understand, you video helped me alot
@maxfrischdev Жыл бұрын
what ever your reason was, that made you stop making videos. 1. Thanks for making them, really well explained! Hut ab! 2. The market for tutorial creators might seem "overcrowded" but really sad that you stopped, I think you have great potential! Have a good life, mate! 🤘
@FelixTechTips Жыл бұрын
Vielen vielen Dank für die nette Worte. Ich hatte wenig Zeit in den letzten Jahren, aber ich plane ab 2024 weiterzumachen :) Grüße nach Indonesien :)
@maxfrischdev Жыл бұрын
@@FelixTechTips dann wünsche ich dir einen starken Start im neuen Jahr! 💪🏻🤘🏻🤘🏻🤘🏻🤘🏻😁
@sudiptadas62614 ай бұрын
@@FelixTechTips Really eager to get your videos more and more on algorithms and coding.
@hastingschingwena52383 жыл бұрын
That was an amazing way of explaining quick sort thanks
@Mc-os1yc3 жыл бұрын
In your visual explanation, you mentioned a scenario where j < i. That will never happen in your code because both while loops break when i=j. Anyway, it's a good vid nonetheless. thanks
@jeanluc91292 жыл бұрын
I don't think that's right. Only the outer loop will break when i=j
@igorku73693 ай бұрын
Yes, I also found this discrepancy. Probably just an omission on author's side. But in general - wonderful explanation, thanks a lot!
@andrew15_55 ай бұрын
9:46 You forgot to say "- 1" after "right will be the length of the array" (since left starts at 0 and not 1). The explanation is great! I forgot about how this works after several years of no practice, but now I remembered everything!
@TheKorkahn4 жыл бұрын
nice smoothing voice, thanks for the explanation FelixTechTips!!
@aungkyawkhant321 Жыл бұрын
Incredible explanation!
@FelixTechTips Жыл бұрын
Thank you :)
@EmmaLovesCoding4 ай бұрын
man thanks a lot even though i don't get it well yet but i will rewatch again
@ibrohimahmadjonov68592 жыл бұрын
Thank you for so comprehensive explanation
@creative_py91692 жыл бұрын
Very good explanation
@PureCrimsonLotus2 жыл бұрын
At 11:08, you say "the j that defines the point right of the pivot," but if the pivot is always the last element in the array, nothing can be to its right. Did you mean "the point left of the pivot"?
@zakthesquirrel7621 Жыл бұрын
i think he wanted to say "right next to the pivot"
@samuelvalentine7846 Жыл бұрын
For me, i found another way to do the partitioning using a for loop in python def partition(arr, high, low=0): if not arr and not high: return 'No array and no upperbound' pivot = arr[high] partion_at = low for j in range(low, high): if arr[j]
@atharvachouhan474 Жыл бұрын
No
@samuelvalentine7846 Жыл бұрын
@@atharvachouhan474 no what?
@atharvachouhan474 Жыл бұрын
@@samuelvalentine7846 yes
@potlurisairaj66692 жыл бұрын
you saved my time thank you
@ahmedel-sinousy48483 ай бұрын
thank you for explanation but I'm looking for in-place implementation for the quick sort because it's an in-place one
@DJsteuph11 ай бұрын
when i does not get incremented if the while loop does not run at all initially, that then creates a negative -1 right parameter in the quicksort(arr, left, partition_pos-1) ,where partition_pos=0, function later on. Why isn't this a problem?
@darcash17389 ай бұрын
Could we also make the right endpoint just the very end of the array and the left at index 0? Or how would we do it if a different pivot was used?
@rpalanivel83 Жыл бұрын
Thanks for the wonderful video. The code was not worked for me. It went infinite loop. I fixed the issue by adding i += 1 and j -= 1 after arr[i], arr[j] = arr[j], arr[i]
@Plum-v6p11 ай бұрын
Hey !your explanation is great.one quick question Python has line by line interpreter So,when we call partition function won't that cause declaration error because it should be declared first before calling...
@SpencerBoucher3 жыл бұрын
I'm having trouble understanding one thing. After i and j meet, shouldn't we just unconditionally exchange arr[i] and the pivot? Why do we check that arr[i] > arr[right] at that point? Shouldn't the pivot be placed at that point that i and j meet in order to be properly sorted?
@manojkarthik61583 жыл бұрын
Same doubt bro
@jacqueline23302 жыл бұрын
i think the check is considering the case that only TWO elements were left. we always pick up the last element as our pivot, and the remaining one will become the one=i=j automatically. so we should check it first before we swap them. Like in the video 8:27, what if we have 77 88 left already inplace instead of 88 77?
@lakshyachaturvedi27125 ай бұрын
In your example there was no scene where you swapped the elements at I and j position then why did you do so in code?
@VladislavRashkov-e6w5 ай бұрын
Thank you!
@ermiasendale Жыл бұрын
Why don't we use "if array[i] > pivot and i > j "# indicating that they have crossed each other instead of "if array[i] > pivot:" since our objective is to handle the scenario where they cross each other?
@AM-nl5yo2 жыл бұрын
Thank you, this helps me ✨
@Anjalikumari-cl7zx28 күн бұрын
please made more videos on other topic also please
@jasmineshaik7025 Жыл бұрын
Super.....but ur code should be zoomed it will look better anyway nice ❤️
@jenniferr3204 Жыл бұрын
Thank you! Your explanations were very good. How would I change the code for parallel quickSort? Is dynamic parallel quickSort the same as just parallel quickSort?
@darcash17389 ай бұрын
I’m not sure what this means but this sounds like you could know the answer to this. Could we also make the right endpoint just the very end of the array and the left at index 0? Or how would we do it if a different pivot was used?
@ahmet82663 жыл бұрын
I got it thank you
@liiiaaaaammm9 ай бұрын
cual es la condicion de parada para la recursion?
@Hex-Scholar Жыл бұрын
Could you please explain me what will the space complexity be ?
@77elite96 ай бұрын
I may be late but Quicksort has O(logn) space complexity. This is due to the algorithm recursively calling itself which takes up space in memory because it must remember where it was in the previous levels of recursion. Because Quicksort on average has log base (4/3) of n recursion levels as that is the average partition for Quicksort and log base (4/3) of n is in O(logn), that is its space complexity.
@alex_reye2 жыл бұрын
Thank you so much for the explanation! By the way, how should this algorithm be implemented with random element chosen as the pivot?
@anirudhsoni65292 жыл бұрын
we could use any element as pivot in this case he has taken the last one
@darcash17389 ай бұрын
@@anirudhsoni6529would we put the right pointer at the very end of the array instead of how he has it here, where it is just left of the last element?
@nkwellekwo80512 жыл бұрын
Please why is J right -1?
@kummaridharmateja9593 Жыл бұрын
right means size of array i.e, 8 here index will start from 0th so array[last_ment] =>array[8] it means we dont have 8th element in array thats why right -1
@mohamed5986 Жыл бұрын
i faced a problem in it that quick sort isn't quick with me at all idk why it doesn't work i guess my laptop is kinda weak
@abhiprit203 жыл бұрын
Instead of passing list as input, if tuple, dictionary, set is passed. So will the time complexity of the algorithm remains same or will differ? Thanks,
@jesmigeorge49363 жыл бұрын
Now this won't work on tuple i suppose because tuples are immutable and in this algorithm we swap and make changes in place itself. So.. Nope it won't work for tuples.it would give us error... So it's time complexity might not be there with tuples.
@theInspireVista Жыл бұрын
Can you please upload the quick sort for worst case scenario with O(n^2) ?
@davidr.603 Жыл бұрын
That happena when the pivot element is either really big or really small not sure which it was, maybe both
@BOPPANAAJITHAАй бұрын
Thank you so much
@olafschlammbeutel4 жыл бұрын
Nice animations!
@rdanimetalks79642 жыл бұрын
Sirr where r urrr Videos... it's been a yearr...Did u quit???? 😭😭😭
@mbappekawani97163 жыл бұрын
j can be less than i???
@user-qb5tg6eg2e3 жыл бұрын
13:36 my own video mark
@the_gadfly57172 жыл бұрын
What if there are duplicates?
@seabass76154 ай бұрын
Danke bro!
@allandogreat2 жыл бұрын
good works
@logofios Жыл бұрын
Cool!
@shootanees150 Жыл бұрын
Dadu pashu 😍😍😍😍
@trl2006 Жыл бұрын
Why return i?
@ejazxdd Жыл бұрын
Kalander op
@andresc.56 Жыл бұрын
ur awesome
@walternathaniel73652 жыл бұрын
If you run the sorting function, the result is None. This is because the sorting function does not Return anything. You may want to edit your code.
@kimstuart79892 жыл бұрын
works fine for me. It isn't returning anything because this algorithm is designed to be in-place and it is just modifying the original array itself. print your array, call quick_sort(), then print your same array again and you will see it sorted. If you want, you can add return arr at the end of your quick_sort function, then in your main call it using sorted_array = quick_sort(), but it's not necessary.
@reo44652 жыл бұрын
it will work just fine cause he is sending list as a parameter and that is passed by reference
@matissjansons8789 Жыл бұрын
how about this: def quicksort(arr): if len(arr) pivot] return quicksort(left) + middle + quicksort(right)
@lucianaferrand642 жыл бұрын
ok, I posted a comment before that was incorrect. I was missing a piece of code - Works wonderfully - Here is another example in python of quickSort application Check my function below and works for any example of an array. def quickSort(dataset, first, last): if first < last: pivotIdx = partition(dataset, first, last) # now sort the two partitions quickSort(dataset, first, pivotIdx-1) quickSort(dataset, pivotIdx+1, last) def partition(datavalues, first, last): # choose the first item as the pivot value pivotvalue = datavalues[first] # establish the upper and lower indexes lower = first + 1 upper = last # start searching for the crossing point done = False while not done: # TODO: advance the lower index while lower = lower: upper -= 1 # TODO: if the two indexes cross, we have found the split point if upper < lower: done = True else: # if they haven't cross each other temp = datavalues[lower] datavalues[lower] = datavalues[upper] datavalues[upper] = temp temp = datavalues[first] datavalues[first] = datavalues[upper] datavalues[upper] = temp # return the split point index return upper # test the merge sort with data print(items) quickSort(items, 0, len(items)-1) print(items)
@THE-MNG3 жыл бұрын
I got an error when I use 100 elements of array
@Mc-os1yc3 жыл бұрын
I suppose it's stack overflow cuz it hits stack size of your system
@aids_47_aditishetty842 жыл бұрын
unbound local partition error
@shashankdevadiga2646 Жыл бұрын
I think it's ' j= right '
@sayham9118Ай бұрын
Bro this could have been done with a single while loop, why increase time complexity. Nice vdo but you lost me there
@little_stories_cornerАй бұрын
the program operates exactly how he explained it , not a single instruction more , tell me