bbnode.h

来自「data structures, algorithms and Applicat」· C头文件 代码 · 共 33 行

H
33
字号
// used by bbloadd.cpp

#ifndef bbnode_
#define bbnode_

template <class T> class HeapNode;
template <class T> class MaxHeap;

class bbnode {
   friend void AddLiveNode(MaxHeap<HeapNode<int> > &, bbnode *,
                             int, bool, int);
   friend int MaxLoading(int *, int, int, int *);
   friend class AdjacencyGraph;
   private:
      bbnode *parent; // pointer to parent node
      bool LChild;    // true iff left child of parent
};

template<class T>
class HeapNode {
   friend void AddLiveNode(MaxHeap<HeapNode<T> > &, bbnode *,
                   T, bool, int);
   friend T MaxLoading(T *, T, int, int *);
   public:
      operator T () const {return uweight;}
   private:
      bbnode *ptr;  // pointer to live node
      T uweight;    // upper weight of live node
      int level;    // level of live node
};

#endif

⌨️ 快捷键说明

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