?? list.h
字號:
#pragma once
#include "list.h"
#include <iostream>
using namespace std;
template <class Type> class List;
template <class Type> class Node
{
Type contents;
Node * next;
friend List<Type>;
};
template <class Type> class List
{
public:
List();
~List();
bool IsEmpty() const {return (pHead==NULL) ? true : false;}//判斷鏈表是否為空
int Length() const {return length;} //返回鏈表中的元素總數
bool Find(int k, Type & intnum) const; //尋找鏈表中的第k個元素,并將其傳送至intnum
int Search(const Type & intnum) const; //尋找intnum,如果發現intnum,則返回intnum的位置,如果intnum不在鏈表中,則返回0
void Delete(int k, Type & intnum); //把第k個元素取至intnum,然后從鏈表中刪除第k個元素
void Insert(int k, const Type &intnum); //在第k個元素之后插入intnum
void Modify(int k,const Type &intum);//將第k個元素的值修改為intnum
void ShowListNode(); //顯示輸出鏈表的所有數據
private:
Node<Type> *pHead;
int length;
};
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -