Understand Quick Select (In 10 mins)

  Рет қаралды 20,377

CS Robot

CS Robot

Күн бұрын

Пікірлер: 50
@bouzie8000
@bouzie8000 8 ай бұрын
Believe it or not, this is the best quick select explanation on youtube.For the first timein my life, i can write this algorithm without memorization
@aliramazani2024
@aliramazani2024 5 ай бұрын
I can say this video is the best explanation of the quick select algorithm on KZbin. I read an article on GeeksforGeeks and only found myself more confused because of poor variable naming such as x and y, and weird way of partitioning like right - left, and so on. The method in this video and the explanation make more sense! Thanks CS Robot!
@lunchbox1553
@lunchbox1553 24 күн бұрын
Never go to geeksforgeeks. It is by far the worst resource on the Internet because none of the articles are reviewed and you don't need any credentials to write one.
@ChillWithAbhishek
@ChillWithAbhishek 4 ай бұрын
One of the better explanations out there. The thing with partition is that there are various ways to do it and so many nuances with the boundary conditions if you are not careful. There is another method using while loops which I have always found tad bit more difficult. This one is more straightforward.
@LavanVivekanandasarma
@LavanVivekanandasarma Ай бұрын
This is an unbelievably concise yet helpful explanation - thanks a ton
@MrJ3
@MrJ3 Жыл бұрын
What a great, down to earth explanation.
@saisardesai5548
@saisardesai5548 9 ай бұрын
straight to the point and no nonse explaination!, thanks for explaining the partition function now I can easily remember the solution
@דבירגיל
@דבירגיל 27 күн бұрын
brilliant. One of the best algorithm explanations here. fine work thank you!
@spooki6637
@spooki6637 Жыл бұрын
thank you for your explanation it is super clear and concise thank you
@AbhijeetMishra-bl7yr
@AbhijeetMishra-bl7yr Жыл бұрын
Keep posting these king of videos Great usage of example and step by step impl explanation. Keeping it simple
@neev4n
@neev4n 4 ай бұрын
lowkey the best quickselect explanation ever what
@COURATWENTYTHREE
@COURATWENTYTHREE 2 ай бұрын
Best Quick Sort explaination❤❤❤❤
@Sha-256-rath
@Sha-256-rath Жыл бұрын
really appreciate your way of explaining😇😇
@shauryatomer1058
@shauryatomer1058 2 ай бұрын
Man you make such great videos, why'd you stop?
@godofpeak1240
@godofpeak1240 4 ай бұрын
You easily had the best video on it, thank you!
@AbhijeetMishra-bl7yr
@AbhijeetMishra-bl7yr Жыл бұрын
This is best as far as I have seen on YT I was really stuck at I and J pointer. nailed it 🔥
@juancarlosvillanuevaquiros6763
@juancarlosvillanuevaquiros6763 6 ай бұрын
Super good explanation video. This deserves more views
@pikachupika7203
@pikachupika7203 Ай бұрын
best video ever for quickselect
@mvkful
@mvkful Ай бұрын
Perfect explanation! Thank you
@arandomcoder101
@arandomcoder101 Жыл бұрын
How do you make these graphics ? Is it a presentation ? Slides , or something like manim ?
@boojo3
@boojo3 Жыл бұрын
thank you so much this helped me understand very quickly
@andrewknyazkov6877
@andrewknyazkov6877 Жыл бұрын
thank you so much. that was a great explanation
@balapradeepkumarm5206
@balapradeepkumarm5206 Жыл бұрын
Is this works if the last element in an array is the largest?, bcoz the arr[i] and arr[r] swaps at the end of the each iteration right
@lunchbox1553
@lunchbox1553 24 күн бұрын
Shouldn't the time complexity be denoted big theta of n and big O of n^2?
@Nishit_369
@Nishit_369 6 ай бұрын
Awesome explanation. Thanks!!!
@StephaneArcher
@StephaneArcher Жыл бұрын
Great explanation, thank you
@attafriski5901
@attafriski5901 Жыл бұрын
You have good explanation, Thanks it's help me a lot
@rajsriselvansrp4831
@rajsriselvansrp4831 2 ай бұрын
Good work!
@andrii5054
@andrii5054 Жыл бұрын
Great Explanation, thank you
@kevinthant2952
@kevinthant2952 10 ай бұрын
Very good explanation, thank you!
@JikeWimblik
@JikeWimblik Ай бұрын
Fill the empty cells in the rows with their basic possibilities given the numbers in the sub grid row and column no need to do any more working out. Now go from left to right or right to left ignore the data in your cell and see what numbers ain't covered by the possibilities in the other cells or the cells already solved. If there are no possibilities deduced move to the next empty cell and wipe the info in the cell you just tested. If you do find a possible number or 2 from this test then the solution is that number or is one of those numbers. It's a very quick O n time test that trips the game of sudoku up and ruins it for everyone.
@jnayehsirine6222
@jnayehsirine6222 5 ай бұрын
great video , it deserves more views
@kurtlarsen8270
@kurtlarsen8270 9 ай бұрын
good explanation, thanks
@akashkadam2741
@akashkadam2741 7 ай бұрын
really well explained
@mariuszpudzianowski7475
@mariuszpudzianowski7475 6 ай бұрын
great explanation
@beik118
@beik118 11 ай бұрын
really really good video
@eriklee1131
@eriklee1131 7 ай бұрын
great video!
@ahmedabdelalem4326
@ahmedabdelalem4326 8 ай бұрын
this is the first time i can understand algorithms from the first time.
@alibozkurt7767
@alibozkurt7767 Жыл бұрын
thanks
@knowsbetter4113
@knowsbetter4113 Жыл бұрын
Love from india
@apbh
@apbh 6 ай бұрын
Isn't the third largest element 10 here?
@surters
@surters Жыл бұрын
Selecting the last as pivot is risky, selecting a random is much better.
@Fran-kc2gu
@Fran-kc2gu 11 ай бұрын
lol no, if the order it's random which almost always is it's the same
@surters
@surters 11 ай бұрын
@@Fran-kc2gu Depend on the input as you say, but you hit the worst case O(N^2) if the list if already sorted, which is a denial of service attack vector. If your having a critical timeout you must meet you should even go with a median-of-medians.
@alexandrch1758
@alexandrch1758 9 ай бұрын
how can we adopt the partition function to select a random pivot? Just pivot = arr[randint(l, r)] doesn't work
@JimBob1937
@JimBob1937 6 ай бұрын
@@surters , if your list is unsorted, arguably list.length - 1 slot will follow a random distribution. Your worst case depends not only on the list but the kth position you're trying to find. It is true, a random selection can reduce worst case chance still, but it really is something you should judge on your use case. Your real world distribution of your list may not hit the worst case scenario as often as other distributions. If your list is small, your usage of random may actually incur more overhead than just selecting a fixed pivot. Don't let big O complexity blind you to the underlying complexity and overhead of the functions you call in your algorithms, or that the complexity depends on external factors to the algorithm, like the expected distribution of your list. For a DOS attack, your user would have to control the list and search position and the specific implementation would need to affect the shared resources appreciably. Your advice thus is highly specific to a very specific use case and implementation that isn't broadly of concern.
@surters
@surters 6 ай бұрын
@@JimBob1937 If it is OK that sometimes O(N^2) is acceptable and the data is not depending on potential hostile 3rd party input, it could be OK. If your dealing with potentially hostile 3rd party inputs, depending on a predictable pivot is not advisable, picking a random pivot might be good enough. If on the other hand you can never afford to hit O(N^2) ever, then median of medians is an option. There is tons of literature on the matter.
@judowithkeishin
@judowithkeishin 4 ай бұрын
The time complexity is wrong, its o(n^2) worst case if you select the largest or smallest element in the array
Truly Understanding Quick Select
17:53
Truly Understanding Algorithms
Рет қаралды 13 М.
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 125 МЛН
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 15 МЛН
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 121 МЛН
How it feels when u walk through first class
00:52
Adam W
Рет қаралды 24 МЛН
Quicksort: Partitioning an array
4:48
KC Ang
Рет қаралды 586 М.
Good Book about Low-Level C++ [from a quant dev]
7:04
The Quantitative Developer
Рет қаралды 3,6 М.
Learn Quick Sort in 13 minutes ⚡
13:49
Bro Code
Рет қаралды 362 М.
Quick Sort and Quick Select
21:36
Algorithms with Attitude
Рет қаралды 27 М.
you will never ask about pointers again after watching this video
8:03
The LeetCode Fallacy
6:08
NeetCode
Рет қаралды 548 М.
8 patterns to solve 80% Leetcode problems
7:30
Sahil & Sarra
Рет қаралды 403 М.
Top 7 Algorithms for Coding Interviews Explained SIMPLY
21:22
Codebagel
Рет қаралды 421 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 622 М.
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 125 МЛН