summaryrefslogtreecommitdiff
path: root/lib/BinHeap.cc
diff options
context:
space:
mode:
authorPixel <>2001-03-05 01:31:31 +0000
committerPixel <>2001-03-05 01:31:31 +0000
commit04d8a10293bdb5407127dc7693da33e168fa4d5c (patch)
tree565999a7a82585f9f5b310e1706a4107b5bd7331 /lib/BinHeap.cc
parentdfd868ecf9e37a5e6954a073c3ba43a970f7ca54 (diff)
Changement d'indentation
Diffstat (limited to 'lib/BinHeap.cc')
-rw-r--r--lib/BinHeap.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/BinHeap.cc b/lib/BinHeap.cc
index 89dd0be..45f77e6 100644
--- a/lib/BinHeap.cc
+++ b/lib/BinHeap.cc
@@ -23,7 +23,7 @@ void BinHeap::PackUp(int i)
{
int l = LEFT(i), r = RIGHT(i), min;
binheap_t *binheap = (binheap_t *) Datas;
-
+
min = ((l <= Key) && (binheap[l - 1].Key < binheap[i - 1].Key)) ? l : i;
if ((r <= Key) && (binheap[r - 1].Key < binheap[min - 1].Key))
min = r;
@@ -51,10 +51,11 @@ PriorityList *BinHeap::Union(PriorityList * P)
bool BinHeap::Lower_Key(Cell x, Key_t NKey)
{
- int i = ((binheap_t *)x) - ((binheap_t*)Datas) + 1;
- binheap_t * binheap = (binheap_t*) Datas;
+ int i = ((binheap_t *) x) - ((binheap_t *) Datas) + 1;
+ binheap_t *binheap = (binheap_t *) Datas;
- if (((binheap_t*)x)->Key < NKey) return false;
+ if (((binheap_t *) x)->Key < NKey)
+ return false;
while ((i > 1) && (binheap[FATHER(i) - 1].Key > NKey)) {
SWAP(binheap[i - 1], binheap[FATHER(i) - 1]);
i = FATHER(i);
@@ -124,7 +125,7 @@ Cell BinHeap::Insert(Key_t IKey, Datas_t const &IDatas)
i = Key;
binheap = (binheap_t *) Datas;
-
+
while ((i > 1) && (binheap[FATHER(i) - 1].Key > IKey)) {
binheap[i - 1] = binheap[FATHER(i) - 1];
i = FATHER(i);