39 std::cout <<
"minHeap overflow. \n" ;
42 int parent = (current - 1)/2;
45 if (h[current].info->load < h[parent].info->load)
47 swap(current, parent);
49 parent = (current-1)/2;
59 if (count == 0)
return 0;
76 if (h[c1].info->load < h[c2].info->load)
81 if (h[best].info->load < h[current].info->load)
101 if (iter->
next >= count)
104 return h[iter->
next - 1].info;
129 h[count].deleted = 0;
134 std::cout <<
"maxHeap overflow. \n" ;
137 int parent = (current - 1)/2;
140 if (h[current].info->load > h[parent].info->load)
142 swap(current, parent);
144 parent = (current-1)/2;
154 if (count == 0)
return 0;
170 if (h[c1].info->load > h[c2].info->load)
175 if (h[best].info->load > h[current].info->load)
197 if (iter->
next >= count)
200 return h[iter->
next - 1].info;
void swap(Array< T > &s, Array< T > &t)
InfoRecord * next(heapIterator *)
InfoRecord * next(heapIterator *)
InfoRecord * iterator(heapIterator *)
InfoRecord * iterator(heapIterator *)