Assignment5
Assignment5
#include<stack>
#include<algorithm>
#include<vector>
int x, y;
};
stk.pop();
return res;
if (val == 0)
return 0; //colinear
if(dir == 0)
return (dir==2)? -1 : 1;
vector<point> convexHullPoints;
int y = points[i].y;
minY = points[i].y;
min = i;
p0 = points[0];
//when the angle of ith and (i+1)th elements are same, remove points
i++;
points[arrSize] = points[i];
arrSize++;
}
if(arrSize < 3)
stack<point> stk;
stk.pop(); //when top, second top and ith point are not making left turn, remove
point
stk.push(points[i]);
while(!stk.empty()) {
stk.pop();
int main() {
int n = 6;
vector<point> result;
vector<point>::iterator it;
cout << "(" << it->x << ", " <<it->y <<") ";