3 5 On log n Algorithm for Closest Pair II Advanced Optional 19 min

  Рет қаралды 13,179

Stanford Algorithms

Stanford Algorithms

Күн бұрын

Пікірлер: 16
@DaniloSouzaMoraes
@DaniloSouzaMoraes 5 жыл бұрын
The algorithm is beautiful and the instructor is very good. Very clear explanation
@jianxiang
@jianxiang 6 жыл бұрын
This thinking inspires me a lot.
@code-with-carlos
@code-with-carlos 4 жыл бұрын
I was certainly confused with that seven points for-loop comparison in the previous video. This video made me realize of how cool this algorithm is. It is fairly interesting to see how the paradigm Divide and Conquer can drive to such algorithms.
@__redacted__
@__redacted__ 4 жыл бұрын
So the magic of all of this is in 1) using the delta derived from the distance between 2 points in Q or R to feed into the 3rd subroutine 2) recognizing the Pythagorean distance based on delta 3) respecting the split pair definition and 4) enumerating through the remaining possible pairings for a given point
@nahjeesowah6022
@nahjeesowah6022 2 жыл бұрын
euclidean distance !=pythagorean distance
@hidude1354
@hidude1354 2 жыл бұрын
@@nahjeesowah6022 aren't all euclidean distances in essence pythagorean distances? euclidean distances are just distances between two points calculated from pythagoras' theorem so I don't see why this point is brought up
@nimishshah3971
@nimishshah3971 6 жыл бұрын
This is insane!
@JoeBaloney
@JoeBaloney Жыл бұрын
Taking the base cases into consideration, we can have a max of 3 points on the left and a max of 3 points on the right, so the worst-case scenario for the ClosestSplitPair() function is to loop over 3X3=9 times to find the closest-split pair, which is a different number from the 8-square method. Where is the missing point? (no pun intended)
@jiaruowang9492
@jiaruowang9492 4 жыл бұрын
Thank you so much for the great great explanation. I would have dropped my algorithm class otherwise...
@jonathanlee8162
@jonathanlee8162 2 жыл бұрын
Can we use max 4 instead of 7? But that is if j iterates from after x bar.
@jonathanlee8162
@jonathanlee8162 2 жыл бұрын
But yup I understand that it’ll still be O(n) even if it’s 4
@nahjeesowah6022
@nahjeesowah6022 2 жыл бұрын
now the real question is why 8 boxes, with this definition it could be variety of constants
@soon931111
@soon931111 4 жыл бұрын
I'm sorry, isn't the graph you drew called horizontal strip instead of vertical strip?
@mcpickle91
@mcpickle91 3 жыл бұрын
if you mean at 6:50, then I agree.
@jonathanlee8162
@jonathanlee8162 2 жыл бұрын
It’s the set of points from y = infinity to y= -infinity And between x bar + d and x bar - d. So yea it’s a vertical strip, but he didn’t draw the vertical lines
@CLG111
@CLG111 27 күн бұрын
That was a very poor explanation. Didn't make a bit of sense. And people are paying Stanford dollars for this?
4   1   Motivation 8 min
7:48
Stanford Algorithms
Рет қаралды 19 М.
3   4   On log n Algorithm for Closest Pair I Advanced   Optional 32 min
31:47
Stanford Algorithms
Рет қаралды 33 М.
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 6 МЛН
When u fight over the armrest
00:41
Adam W
Рет қаралды 24 МЛН
11   3   Correctness of Dijkstra 's Algorithm Advanced   Optional 19 min
19:18
Stanford Algorithms
Рет қаралды 9 М.
2. Divide & Conquer: Convex Hull, Median Finding
1:20:35
MIT OpenCourseWare
Рет қаралды 202 М.
3   1   On log n Algorithm for Counting Inversions I 13 min
12:36
Stanford Algorithms
Рет қаралды 54 М.
Closest Pair of Points (Divide and Conquer) Explained
8:45
The Brachistochrone, with Steven Strogatz
16:02
3Blue1Brown
Рет қаралды 1,3 МЛН
How on Earth does ^.?$|^(..+?)\1+$ produce primes?
18:37
Stand-up Maths
Рет қаралды 377 М.
8   3   Deterministic Selection   Algorithm Advanced   Optional 17 min
16:57
Stanford Algorithms
Рет қаралды 14 М.
How to find the closest pair of points in O(nlogn)? - Inside code
12:22
5   4   Choosing a Good Pivot 22min
22:26
Stanford Algorithms
Рет қаралды 17 М.
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 6 МЛН