diff options
author | Pixel <> | 2001-02-28 11:40:25 +0000 |
---|---|---|
committer | Pixel <> | 2001-02-28 11:40:25 +0000 |
commit | 833d20a69fe17ab846c153e35230c66a41d8fca9 (patch) | |
tree | 180ba073e59fee8df22cb733be2eec4c452e1b85 /include/BHeap.h |
Premier jetstart
Diffstat (limited to 'include/BHeap.h')
-rw-r--r-- | include/BHeap.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/BHeap.h b/include/BHeap.h new file mode 100644 index 0000000..ab63852 --- /dev/null +++ b/include/BHeap.h @@ -0,0 +1,38 @@ +#ifndef __BHEAP_H__ +#define __BHEAP_H__ +#include <PCommon.h> +#include <CList.h> + +#ifdef __cplusplus +class BHeap:public PriorityList { + private: + int Degree; + BHeap *Father, *Child, *Brother; + CList *FP; + + void Link(BHeap * z); + void Merge(BHeap * H); + BHeap(Key_t IKey, Datas_t const &IDatas); // Insert + Cell Insert(BHeap * x); + + public: + BHeap(void); // Constructor + ~BHeap(void); // Destructor + virtual int rn(void); + virtual Key_t ReadKey(Cell C); + virtual Datas_t ReadDatas(Cell C); + + virtual void Dump(ostream & os); + virtual bool IsEmpty(void); + + virtual Cell Min(void); + virtual Cell Insert(Key_t IKey, Datas_t const &IDatas); + virtual Key_t Extract_Min(Datas_t & Datas); + virtual PriorityList *Union(PriorityList * P); + virtual bool Lower_Key(Cell x, Key_t NKey); + virtual Key_t Delete(Datas_t & Datas, Cell x); +}; +#else +#error This librairy will only compile with a C++ compiler. +#endif +#endif |