Constructing a set of points that can generate worst-case time complexity behavior depends on the specific pseudocode you are given in the material you are studying.
The worst case complexity of Quickhull is O(N2), and the average case performance is O(NlogN). As you may have seen, Quickhull follows a divide-and-conquer strategy. Thus, achieving the latter(i.e. better) time complexity depends on being able to divide the problem into 2 similar sized (ideally equal) subproblems. If the dividing step is not balanced, and the number of elements in the 2 subproblems differ greatly, the algorithm will have to recurse N times. In other words, in each recursive step, the problem size will be reduced by a constant amount, instead of being reduced to a fraction of the original problem size.
Now, the pseudocode you provided takes the points with the lowest and highest X coordinates(i.e. leftmost and rightmost points) as bounds to divide the space into two. Ideally, this should divide the points into 2 equally large sets. But, what if this method is rendered inefficient by the specific points given as input? Then, at each step you would possibly exclude only a constant amount of points, say c
, and the other half would still include N-c
points. Consequently, the problem would have to recurse down O(N) steps and would end up with a quadratic complexity.
One such example, I believe, would be drawing a V shape with the points, as given below.
(0, 5)
(10, 5)
(1, 4)
(9, 4)
(2, 3)
(8, 3)
(3, 2)
(7, 2)
(4, 1)
(6, 1)
(5, 0)