文件名称:lab22
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.37kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
首先,定义两个对象一个定义了点的x,y坐标和它的标号,另一个对象是两点之间的距离。然后用冒泡比较法对点的x,y坐标分别进行排序,编写控制台程序,输入点的个数,分为两种方法求最近点对。根据点的个数分为3个点的情形和大于3个点的情形,3个点的直接对两两点之间的距离进行比较。大于3点的用分治递归法求解,通过划定界限分8块没一点只对其他7块内的点进行比较长度最后求出最短距离。-First of all, define two object a definition of a x, y and its label, another object is the distance between two points. Then use of the comparative bubbling point x, y sorting respectively, write console application, input the number of points, divided into two kinds of methods for recently to point. According to the number of points divided into 3 point the situation and the greater than three points of the situation, the 3 point directly to the two the distance between the two comparison. More than three points with partition of the recursive method to solve, through the delimit limits points and eight pieces of other 7 didn t 1:00 only block point comparison for the most short length at last.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
lab22.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.