What is the worst case for quick hull?? And how we can know that it is the worst case
I am confused with quick hull algorithm. Actually, I understood, that running determinant to find the area of a triangle, and if the area is positive, then the point is on the left of the extreme points.
And doing this thing recursively, will have O(n) efficiency for constructing a hull.
Then I don’t understood, that how to efficiency is sometimes mentioned O(nlogn) and )(n^2)? for which cases this efficiency turns out and how?
please if someone can help by some particular example; that would be great help.
What is the worst case for quick hull?? And how we can know that
Share
QuickHull is a fast algorithm because in one of the steps you eliminate a bunch of points that lie inside a triangle. The steps for QuickHull are:
This is the case when your points are placed randomly on the plane, but there are cases when the points are badly distributed and you can’t eliminate any of them in any given step. One of this cases is when the points are in the border of a circle:
As you can see, when this happens, in step 4 of the algorithm above you eliminate no points at all. This is why in the worst case QuickHull is
O(n^2).