Last active
August 29, 2015 14:04
-
-
Save kartikkukreja/a5e3277082fe41620300 to your computer and use it in GitHub Desktop.
Graham Scan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foreach p of the remaining n-3 points in sorted order | |
| while (point next to top in S, S.top(), p) do not form a counter-clockwise turn | |
| S.pop() | |
| S.push(p) | |
| return S |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment