The maximal points of a set are points that have x and y-coordinates which are greater than or equal to the x and y coordinates of every other point. I have a set whose points are sorted by increasing x-coordinates.
This needs to be done recursively/divide-and-conquer.
My approach was akin to:
1. Go to the end of the array to find the coordinates with the largest x-coordinate
2. Do a merge sort on the y-values of these x-coordinates
3. Go to the end of that sorted array, the largest y-values found here are the maximal points.
However, this would be O(n log n) due to the merge sort and I was told that it is possible to write code that runs in O(n). Can anyone provide recursive pseudocode which could do this in linear time?