永发信息网

微波炉不能放什么容器,循环队列只能用数组实现,而不能用链表实现对吗??

答案:1  悬赏:50  手机版
解决时间 2021-04-06 00:38
  • 提问者网友:爱了却不能说
  • 2021-04-05 14:41
微波炉不能放什么容器,循环队列只能用数组实现,而不能用链表实现对吗??
最佳答案
  • 五星知识达人网友:罪歌
  • 2021-04-05 15:07
我实在不知道你们这个题目是什么意思,竟然继承链表来实现队列,帮你实现了,VC6.0通过
//list.h
#ifndef LIST_H
#define LIST_H
#include
using namespace std;
struct Node
{
int data;
Node *next;
};
class List
{
public:
List();
~List();
List(List&rhs);
List &operator=(List&);
int operator >>(int x);//让>>从尾部输入x
int operator data=NULL;
m_pHead->next=NULL;
}
List::List(List&rhs)
{
if(this->get_num!=rhs.get_num)
{
coutnext ;
Node*tmp2=rhs.m_pHead->next;
while(tmp1!=m_pHead)
{
tmp1->data=tmp2->data;
tmp1=tmp1->next;
tmp2=tmp2->next;
}
}
}
List&List::operator=(List&rhs)
{
if(this->get_num()!=rhs.get_num())
{
coutnext ;
Node*tmp2=rhs.m_pHead->next;
while(tmp1!=m_pHead)
{
tmp1->data=tmp2->data;
tmp1=tmp1->next;
tmp2=tmp2->next;
}
}
return *this;
}
List::~List()//释放所有的内存
{
Node *i=m_pHead->next;
while(i!=m_pHead)
{
Node *j=i->next;
delete i;
i=j;
}
d......余下全文>>
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯