record.h

来自「这是本人精心搜集的关于常用图论算法的一套源码」· C头文件 代码 · 共 23 行

H
23
字号
template <class K> 
class Record
{ friend bool operator==(const Record &x, const Record &y) {return x.key==y.key; }
  friend bool operator<(const Record &x, const Record &y) { return x.key<y.key; }
  friend bool operator>(const Record &x, const Record &y) { return x.key>y.key; }
  friend bool operator>=(const Record &x, const Record &y) { return x.key>=y.key; }
  friend bool operator<=(const Record &x, const Record &y) { return x.key<=y.key; }
  friend bool operator!=(const Record &x, const Record &y) { return x.key!=y.key; }
//  friend  ostream &operator<<(ostream& out,Record<K> &x)
//   { return out<<x.key<<' '; }

 public:
  Record():key(-999){}
  Record(K k):key(k){}
  Record(const Record& copy)
   { key=copy.key;  other=copy.other; }
  Record& operator=(const Record& copy)
   { key=copy.key;  other=copy.other; return *this; }
  K Getkey(){ return key;  } 
  private:
    K key;
    char *other;
};

⌨️ 快捷键说明

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