HULL_SORT(A)
- for i ← 0 to n-1 do
- pi ← (A[i],(A[i])2)
- C = ConvexHull(P)
- i ← 0
- for p ← the leftmost point in the hull to the rightmost point do
- A[i] ← p.x
- i ← i + 1
- return A
TOPOLOGICAL_SORT(G)
- DFS(G), to compute f[v] for each vertex.
- as each vertex is finished, insert it into the front of a linked list
- return this list of vertexes.