⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node.h

📁 易学c++源码
💻 H
字号:
//node.h
#include <iostream>
using namespace std;
class Node//定义一个链表结点类
{
public:
	Node();//构造函数的声明
	Node(Node &n);
	Node(int i,char c='0');//构造函数重载1
	Node(int i,char c,Node *p,Node *n);//构造函数重载2
	~Node();//析构函数
	int readi() const;//读取idata
	char readc() const;//读取cdata
	Node * readp() const;//读取上一个结点的位置
	Node * readn() const;//读取下一个结点的位置
	bool set(int i);//重载,通过该函数修改idata
	bool set(char c);//重载,通过该函数修改cdata
	bool setp(Node *p);//通过该函数设置前驱结点
	bool setn(Node *n);//通过该函数设置后继结点
	static int allocation();//返回已分配结点数
private: 
	int idata;//存储数据保密
	char cdata;//存储数据保密
	Node *prior;//前驱结点的存储位置保密
	Node *next;//后继结点的存储位置保密
	static int count;
};//类定义结束,分号切勿忘记

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -