summaryrefslogtreecommitdiff
path: root/include/BinHeap.h
diff options
context:
space:
mode:
authorPixel <>2001-03-03 22:53:41 +0000
committerPixel <>2001-03-03 22:53:41 +0000
commitdc2ce18ea8e1686e61dce2b924e3607df69a2dcf (patch)
treef035493abaca3227da9bbae2b628afbeb990759c /include/BinHeap.h
parent833d20a69fe17ab846c153e35230c66a41d8fca9 (diff)
Plein de changements
Diffstat (limited to 'include/BinHeap.h')
-rw-r--r--include/BinHeap.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/BinHeap.h b/include/BinHeap.h
new file mode 100644
index 0000000..8273365
--- /dev/null
+++ b/include/BinHeap.h
@@ -0,0 +1,36 @@
+#ifndef __BINHEAP_H__
+#define __BINHEAP_H__
+#include <PCommon.h>
+
+#define GRANUL 8
+
+struct binheap_t {
+ Key_t Key;
+ Datas_t Datas;
+};
+
+#ifdef __cplusplus
+typedef class BinHeap:public PriorityList { private:
+ void PackUp(int i);
+ public:
+ BinHeap(void); // Constructor
+ ~BinHeap(void); // Destructor
+
+ virtual int rn(void);
+
+ virtual void Dump(ostream & os);
+ virtual bool IsEmpty(void);
+ virtual Key_t ReadKey(Cell C);
+ virtual Datas_t ReadDatas(Cell C);
+
+ 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);
+} BinHeap;
+#else
+#error This librairy will only compile with a C++ compiler.
+#endif
+#endif