📄 list.h
字号:
#include "iostream.h"
template<class type> class listnode
{
public:
type data;
listnode<type> *link;
listnode();
};
template<class type> listnode<type>::listnode()
{
link=NULL;
}
template<class type> class list
{
public:
list();
void insert(type value);
listnode<type> *first,*last;
};
template<class type> list<type>::list()
{
first=last=NULL;
}
template<class type> void list<type>::insert(type value)
{
if(first==NULL)
{
first=new listnode<type>;
first->data=value;
last=first;
last->link=NULL;
}
else
{
listnode<type> *newnode=new listnode<type>;
newnode->data=value;
last->link=newnode;
last=last->link;
last->link=NULL;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -