Finding median for given points in a 2-d space (x1, y1, x2, y2......xn,yn)
Find Median of x = x element in sorted x series at position n/2. = xm
Find Median of y = y element in sorted y series at position n/2. = yl
Cumulative median = (xm, yl)
//----------------------------------------------------------------------------------------//
Euclidian Formula to find distance between two points.
Find Median of x = x element in sorted x series at position n/2. = xm
Find Median of y = y element in sorted y series at position n/2. = yl
Cumulative median = (xm, yl)
//----------------------------------------------------------------------------------------//
Euclidian Formula to find distance between two points.
//----------------------------------------------------------------------------------------//
- Given 3 points (x1,y1), (x2,y2), (x3,y3). Find If they form Right-angular-traingle.
- Find d1,d2,d3 and apply Pythagorus theorem.
-
- //----------------------------------------------------------------------------------------//
- 1+2+3+4....+n = O(n*n);
- (1+1/2+1/4+1/8 + ...4/n +2/n)+1/nn = 2n=O(n)

No comments:
Post a Comment