没有合适的资源?快使用搜索试试~ 我知道了~
数据结构--队列实现舞伴配对问题 (舞伴程序 c++)
4星 · 超过85%的资源 需积分: 49 85 下载量 19 浏览量
2009-12-16
18:39:12
上传
评论 9
收藏 32KB DOC 举报
温馨提示
试读
7页
数据结构--队列实现舞伴配对问题 假设在周末舞会上,男士们和女士们进入舞厅时,各自排成一队。 跳舞开始时,依次从男队和女队的队头上各出一人配成舞伴。 若两队初始人数不相同,则较长的那一队中未配对者等待下一伦舞曲。
资源详情
资源评论
资源推荐
#include<iostream>
#include <process.h>
const bool TURE=1;
const bool FAULT=0;
using std::cout;
using std::cin;
using std::endl;
class Node{//链式堆栈的节点类
public:
Node();//构造函数重载 1
Node(int , int , int ,Node *);//构造函数重载 2
void const get_data(int &, int &,int &);//取节点数据
void put_data(int , int ,int );//置节点数据
bool put_next(Node *);//置节点的前驱节点域
bool put_prior(Node *);//置结点的后继结点域
Node* const get_next()const;//取结点的前驱结点域
Node* const get_prior()const;//取结点的后继结点域
private:
Node *next;
Node *prior;
int minute;
int second;
int num;
};
Node::Node()
{
minute=NULL;
second=NULL;
num=0;
next=NULL;
prior=NULL;
}
Node::Node(int x, int y, int z ,Node *p)
{
minute=x;
second=y;
num=z;
next=NULL;
prior=p;
}
void const Node::get_data(int &x, int &y, int &z)
{
x=minute;
y=second;
tongshihuanyouren
- 粉丝: 1
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论4