| 156 | } |
| 157 | |
| 158 | bool Pop(int *i, int *j) |
| 159 | { |
| 160 | HeapElem *tmp = head->next; |
| 161 | if (empty == tmp) |
| 162 | return false; |
| 163 | *i = tmp->i; |
| 164 | *j = tmp->j; |
| 165 | tmp->prev->next = tmp->next; |
| 166 | tmp->next->prev = tmp->prev; |
| 167 | tmp->prev = empty->prev; |
| 168 | tmp->next = empty; |
| 169 | tmp->prev->next = tmp; |
| 170 | tmp->next->prev = tmp; |
| 171 | empty = tmp; |
| 172 | in--; |
| 173 | return true; |
| 174 | } |
| 175 | |
| 176 | bool Pop(int *i, int *j, float *T) |
| 177 | { |