文件名称:Post-Office

  • 所属分类:
  • 控制台(字符窗口)编程
  • 资源属性:
  • [PDF]
  • 上传时间:
  • 2013-11-28
  • 文件大小:
  • 165kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

算法设计与分析中邮局选址问题。

select(int[] array, int begin, int end, int middle)将n个输入元素划分成n/5个组,每组5个

元素,只可能有一个组不是5个元素。用任意一种排序算法,将每组中的元素排好序,并取出每组的中

位数,共n/5个。找出这n/5个元素的中位数。如果n/5是偶数,就找它的2个中位数中较大的一个。

以这个元素作为划分基准。在调用时,只需要将middle参数传入array.length/2就能找到整个数组中的

中位数。然后调用两次computeDistance(int[] array)方法,分别求出各中位数到各个居民点的横坐标

和纵坐标的距离,将两距离相加即为该问题的最优解,最后将结果存入输出文件中。-Algorithm design and analysis problems in the post office location. select (int [] array, int begin, int end, int middle) n input elements will be divided into n/5 groups, 5 elements in each group, there may be only one group is not five elements. With any of the sorting algorithm, the elements of each group sorted and remove the median for each group of n/5 个. Median identify these n/5 elements. If n/5 is an even number, to find the median of its two larger one. With this element as the division benchmarks. When you call, simply middle parameter passed array.length/2 can be found in the median of the entire array. Then called twice computeDistance (int [] array) method, the median distance were calculated for each individual settlements to the horizontal and vertical coordinates, the distance will be the sum of the two is the optimal solution to this problem, the final results into the output file.
(系统自动生成,下载前可以参看下载内容)

下载文件列表





Post Office

...........\answer

...........\......\post0.OUT

...........\......\post1.OUT

...........\......\post10.OUT

...........\......\post2.OUT

...........\......\post3.OUT

...........\......\post4.OUT

...........\......\post5.OUT

...........\......\post6.OUT

...........\......\post7.OUT

...........\......\post8.OUT

...........\......\post9.OUT

...........\Post Office.pdf

...........\test

...........\....\post0.IN

...........\....\post1.IN

...........\....\post10.IN

...........\....\post2.IN

...........\....\post3.IN

...........\....\post4.IN

...........\....\post5.IN

...........\....\post6.IN

...........\....\post7.IN

...........\....\post8.IN

...........\....\post9.IN

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org