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

📄 sllist.h

📁 数据结构与算法分析(C++)(版第二版)源码
💻 H
字号:
template <class Elem, class Compare>
class SLList: protected LList<Elem> {
public:
  SLList(int size=DefaultListSize) : LList<Elem>(size) {}
  ~SLList() {}                  // Destructor
  LList<Elem>::clear;
  bool insert(const Elem& item) { // Insert at right
    Elem curr;
    for (setStart(); getValue(curr); next())
      if(!Compare::lt(curr, item)) break;
    return LList<Elem>::insert(item);
  }
  LList<Elem>::remove;
  LList<Elem>::setStart;
  LList<Elem>::setEnd;
  LList<Elem>::prev;
  LList<Elem>::next;
  LList<Elem>::leftLength;
  LList<Elem>::rightLength;
  LList<Elem>::setPos;
  LList<Elem>::getValue;
  LList<Elem>::print;
};

⌨️ 快捷键说明

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