C++????????????????????
???????????? ???????[ 2014/4/15 10:37:39 ] ????????net
????C++?????????????????????
#include<iostream>
#include<stack>
using namespace std;
template<class T>
class Node
{
private:
T data;
Node<T>* next;
public:
Node()
{
Node=NULL;
}
Node(T d)
{
data=d;
next=NULL;
}
};
template<class T>
class myqueue
{
private:
Node<T> *tail;
public:
myqueue()
{
tail=new Node<T>();
//tail->next=NULL;
tail->next=tail; //???????????????????У??????????????????????????????????е?????????
}
bool empty()
{
//return (NULL==tail->next)
return (tail->next==tail);
}
void push(T d)
{
Node<T> *p=new Node<T>(d);
//p->next=NULL;
p->next=tail->next;
tail->next=p;
tail=p; //??????β????λ??
}
T front() //????е????????
{
if(empty())
{
cout<<"queue is empty!"<<endl;
exit(0);
}
Node<T> *p=tail->next; //????????????????????У?β????????????????????
T data=p->next->data; //???????????????????????????
return data;
}
void pop() //???е?????????????
{
Node<T> *p=tail->next;
Node<T> *q=p->next;
p->next=q->next;
if(q==tail)
tail=p;
delete q;
q=NULL;
}
};
|
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????