文件名称:white_black

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

1、问题描述

设平面上分布着n个白点和n个黑点,每个点用一对坐标(x, y)表示.一个黑点b=(xb,yb)支配一个白点w=(xw, yw)当且仅当xb>=xw和yb>=yw.若黑点b支配白点w,则黑点b和白点w可匹配(可形成一个匹配对).在一个黑点最多只能与一个白点匹配,一个白点最多只能与一个黑点匹配的前提下,求n个白点和n个黑点的最大匹配对数.

2、具体要求

要求:时间效率在O(NlgN)

3、实现方法

基于贪心算法

以x坐标的升序对黑点排序(可用QUICKSORT或者HEAPSORT),对白点生成一个小根堆!-1 Descr iption of the problem based on the distribution of plane n-n-white spots and black spots, each point with a pair of coordinates (x, y) said. A black point b = (xb, yb) dominating a white point w = ( xw, yw) if and only if xb> = xw and yb> = yw. If the black point b dominant white w, then the black point and white point w b can match (which can form a matched pair). in a black spot at most can only be matched with a white spot, a white point can only match with the premise of a black point, find the n-n-white spots and black spots on the maximum number of matches. 2, specific requirements requirements: time efficiency in the O ( NlgN) 3, Implementation of the greedy algorithm based on x coordinates in ascending order of black spots (available QUICKSORT or HEAPSORT), generating a small white spot root heap!
(系统自动生成,下载前可以参看下载内容)

下载文件列表

2008301500209:黑白点问题\1.cpp

.........................\1.dsp

.........................\1.dsw

.........................\1.ncb

.........................\1.opt

.........................\1.plg

.........................\2008301500209:黑白点问题\1.cpp

.........................\.........................\1.dsp

.........................\.........................\1.dsw

.........................\.........................\1.ncb

.........................\.........................\1.opt

.........................\.........................\1.plg

.........................\.........................\Debug\1.exe

.........................\.........................\.....\1.ilk

.........................\.........................\.....\1.obj

.........................\.........................\.....\1.pch

.........................\.........................\.....\1.pdb

.........................\.........................\.....\vc60.idb

.........................\.........................\.....\vc60.pdb

.........................\.........................\resource.h

.........................\.........................\Script1.rc

.........................\.........................\Script2.rc

.........................\Debug\1.exe

.........................\.....\1.ilk

.........................\.....\1.obj

.........................\.....\1.pch

.........................\.....\1.pdb

.........................\.....\vc60.idb

.........................\.....\vc60.pdb

.........................\resource.h

.........................\Script1.rc

.........................\Script2.rc

.........................\2008301500209:黑白点问题\Debug

.........................\2008301500209:黑白点问题

.........................\Debug

2008301500209:黑白点问题

相关说明

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

相关评论

暂无评论内容.

发表评论

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

源码中国 www.ymcn.org