Skip to content

Instantly share code, notes, and snippets.

@kartikkukreja
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save kartikkukreja/a5e3277082fe41620300 to your computer and use it in GitHub Desktop.

Select an option

Save kartikkukreja/a5e3277082fe41620300 to your computer and use it in GitHub Desktop.
Graham Scan
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