Skip to content

TABLE.h包含的内容

Sumizome Yoshino edited this page Feb 26, 2024 · 1 revision

【内联函数】第十章:内部排序

  • void _D_i_sort_A(const long long a, const long long b);//直接插入排序(内联函数)
  • void _D_i_sort_B(node* a, node* b); //(内联函数)
  • void _B_i_sort_A(const long long a, const long long b);//折半插入排序(内联函数)
  • void _B_i_sort_B(node* a, node* b); //(内联函数)
  • void _H_sort_A(const long long a, const long long b);//堆排序(内联函数)
  • void _H_sort_B(node* a, node* b);// (内联函数)
  • long long _Q_sort_assist_median(const long long a, const long long b) const;//三者取中函数(内联函数)
  • node* _Q_sort_assist_median(node* a, node* b, long long num) const; //(内联函数)
  • long long _Q_sort_assist_DEPTH(long long a) const;//计算栈的最大深度(内联函数)

基本功能

  • explicit LIST();//默认构造函数
  • explicit LIST(const int a);//默认构造函数
  • explicit LIST(const char* a, const int b, const bool WHETHER_FILEPATH);//默认构造函数
  • explicit LIST(const Type* a, const long long length, const int b);//默认构造函数
  • ~LIST();//默认析构函数
  • LIST& operator=(const LIST& x);//重载赋值运算符
  • LIST(const LIST& x);//复制构造函数

第二章:线性表

  • void Silence_T();//开启调试输出
  • void Silence_F();//关闭调试输出
  • void Listinit(const int a);//表的构造函数
  • void Listinit(const char* a, const int b, const bool WHETHER_FILEPATH);//表的构造函数
  • void Listinit(const Type* a, const long long length, const int b);//表的构造函数
  • Type DATA_TYPE_CONVERT(const char* x) const;//将char*数组中存储的数据(char或类char数据除外)强制转换为Type类型
  • LIST CAST_INT(const long long start, const long long end) const;//将表的每个元素强制转换为int类型
  • void Clearlist();//清空表
  • void Clear_resize(const long long a);//清空表,并将表的总大小强制设置为a
  • Type Getelement(const long long a) const;//返回特定序号元素的值
  • void Listappend(const Type b);//向线性表的后面附加一个元素
  • void Listappend(const LIST& b);//向线性表的后面附加一个线性表
  • bool Listempty() const;//判断表是否为空
  • long long Listlength() const;//返回表的长度
  • void ListinsertF(const long long a, const Type b);//向指定位置的前面插入一个元素
  • void ListinsertF(const long long a, const LIST& b);//向指定位置的前面插入一个表
  • void ListinsertR(const long long a, const Type b);//向指定位置的后面插入一个元素
  • void ListinsertR(const long long a, const LIST& b);//向指定位置的后面插入一个表
  • void Listexpand(const long long a);//指定未来要插入的元素总量,根据总量强行扩大线性表的total域
  • void Smart_expand();//线性表智能扩容函数
  • void Listshrink();//缩紧线性表,用于线性表扩容函数的total域设置过大等情况
  • void Smart_shrink(const bool clear);//线性表智能缩紧函数
  • Type Listdelete(const long long a);//删除指定元素
  • void Listdelete(const long long a, const long long b);//删除多个指定元素
  • long long Listsize() const;//返回表的大小(total域)
  • long long Listcapacity() const;//在不扩充线性表的前提下,线性表的剩余容量(total域-length域)
  • void Listresize(const long long a, const Type b);//把表的总大小强制设置为a,多去少补(使用b填充)
  • void Listfill(const long long a, const long long b, const Type x);//使用某种模式将表填充到某个大小
  • void Update(const long long a, const Type b);//更新特定元素的值
  • void Display() const;//输出表的所有元素
  • void Output_to_file(const char* PATH, const bool clear) const;//把表的全部元素输出到一个文件中
  • void Exchange(const long long a, const long long b);//交换表的两个元素的值
  • void Info() const;//输出表的全部信息
  • void Typeswitch(const int target);//将表的类型在线性表和链表之间相互转换
  • void Repair(const int a);//将类型错误的表转换成类型正确的空表
  • int Gettype() const;//返回表的类型
  • void Reverse(const long long a, const long long b);//将线性表的一部分颠倒
  • Type Max() const;//返回表中元素的最大值
  • Type Min() const;//返回表中元素的最小值
  • long double Sum() const;//返回表中所有元素的和

第三章:栈和队列

  • Type Stack_gettop() const;//模仿栈的操作,显示栈顶元素(栈顶元素指表的第一个元素)
  • void Stack_push(const Type& a);//模仿栈的操作,将一个元素入栈
  • Type Stack_pop();//模仿栈的操作,将一个元素出栈
  • Type Queue_gethead() const;//模仿队列的操作,返回队头元素(表的第一个元素)
  • Type Queue_gettail() const;//模仿队列的操作,返回队尾元素(表的最后一个元素)
  • void Queue_enqueue(const Type& a);//模仿队列的操作,向队尾插入新元素
  • Type Queue_dequeue();//模仿队列的操作,删除队头元素

第四章:串

  • bool Repeat_TF() const;//判断串是否有重复元素
  • bool Symmetric_TF() const;//判断串是否对称
  • void Clear_copy(const LIST& b);//将原始串清空,并把串b复制到原始串
  • void Overwrite(const long long a, const LIST& b);//使用串b覆写掉从原始串的第a位开始的内容
  • LIST Substring(const long long a, const long long length) const;//提取子字符串
  • bool Compare(const LIST& b) const;//比较两个字符串是否相同
  • long long Char_erase(const Type& a);//在字符串中删去特定字符
  • long long Char_num(const Type& a) const;//返回字符串中特定字符的总数
  • Type* Type_array(const bool help) const;//以数组的形式输出串中的全部内容
  • Type* Type_array(const long long a, const long long b, const bool help) const;//以数组的形式输出串中的全部内容
  • char* Char_array(const bool help) const;//以char数组的形式输出串中的全部内容
  • char* Char_array(const long long a, const long long b, const bool help) const;//以char数组的形式输出串中的全部内容
  • long long K_M_P(const LIST& a, const long long start, const long long end) const;//串的模式匹配函数(KMP算法)
  • template friend void String_swap(LIST& a, LIST& b);//交换两个字符串的内容
  • template friend void String_sort(LIST** a, const long long b);//字符串排序函数
  • LIST** a前面不可以加const,不然会出错
  • template friend bool Same_TF(const LIST& a, const long long a_start, const long long a_end, const LIST& b, const long long b_start, const long long b_end);//判断两个字符串的一部分是否相同

第九章:查找

  • long long Seq_search(const Type a);//顺序查找
  • LIST Seq_search_all(const Type a) const;//顺序查找,并输出所有值与待查找的值相同的元素的序号
  • long long Bin_search(const Type a);//折半查找
  • long long Fibo_search(const Type a);//斐波那契查找
  • long long Interp_search(const Type a);//插值查找
  • long long STT_search(const Type a, const LIST& WEIGHT) const;//静态树表查找
  • long long AVL_search(const Type a) const;//平衡二叉树查找
  • long long B_TREE_search(const Type a, const long long m) const;//B树查找
  • long long RB_TREE_search(const Type a) const;//红黑树查找

第十章:内部排序

  • bool Sort_TF() const;//判断序列是否有序
  • void D_i_sort(const int seq);//直接插入排序
  • void B_i_sort(const int seq);//折半插入排序
  • void Two_i_sort(const int seq);//2路插入排序
  • void T_i_sort(const int seq);//表插入排序
  • void S_sort(const int seq);//希尔排序
  • void B_sort(const int seq);//起泡排序
  • void Q_sort(const int seq);//快速排序(内省排序)
  • void S_s_sort(const int seq);//简单选择排序
  • void T_s_sort(const int seq);//树形选择排序
  • void H_sort(const int seq);//堆排序
  • void M_sort(const int seq);//归并排序
  • void R_sort(const int seq);//基数排序
  • void Sort(const int seq);//最好的排序函数
  • void Disarrange();//将序列随机重排

运算符重载

  • Type operator[](const long long a) const;//重载[]运算符
  • void operator+=(const LIST& a);//重载+=运算符
  • void operator+=(const Type a);//重载+=运算符
  • template friend ostream& operator<<(ostream& os, const LIST& a);//重载<<运算符
  • template friend fstream& operator<<(fstream& fs, const LIST& a);//重载<<运算符
  • template friend istream& operator>>(istream& is, LIST& a);//重载>>运算符
  • template friend fstream& operator>>(fstream& fs, LIST& a);//重载>>运算符
  • template friend bool operator==(const LIST& a, const LIST& b);//重载==运算符
  • template friend bool operator!=(const LIST& a, const LIST& b);//重载!=运算符
  • template friend const LIST operator+(const LIST& a, const LIST& b);//重载+运算符
  • template friend const LIST operator+(const LIST& a, const Type b);//重载+运算符
Clone this wiki locally