10-11-01ADA09(分治法-最近点对).pptVIP

  • 2
  • 0
  • 约1.23万字
  • 约 26页
  • 2019-08-10 发布于广东
  • 举报
2010-2011-01 《Design and Analysis of Algorithm》 SCUEC 2007-2008-01《Design and Analysis of Algorithms》SCUEC * This principle, although easy and intuitive, is extremely powerful and is indispensable in the analysis of algorithms. * * BF_ClosestPair(P,n) //Finds two closest points in the plane by BF //Input: A list P of n points P1(x1,y1), ……, Pn (xn, yn) //Output: The smallest distance dmin, indices index1 and index2 of the closest pair of points dmin ← ∞ for i ← 1 to n-1 do for j ← i+1 to n do d ← sqrt((xi-xj)2+(yi-yj)2) //sqrt is the square root function i

文档评论(0)

1亿VIP精品文档

相关文档