76 template <
typename KeyType,
typename ValueType>
99 void Reset(
int maxElements);
148 template <
typename KeyType,
typename ValueType>
154 template <
typename KeyType,
typename ValueType>
160 template <
typename KeyType,
typename ValueType>
173 template <
typename KeyType,
typename ValueType>
181 for (
int i = 0; i < maxElements; ++i)
194 template <
typename KeyType,
typename ValueType>
200 template <
typename KeyType,
typename ValueType>
215 template <
typename KeyType,
typename ValueType>
236 int parent = (child - 1) / 2;
261 template <
typename KeyType,
typename ValueType>
280 int parent = 0, child = 1;
281 while (child <= last)
287 int childP1 = child + 1;
305 child = 2 * child + 1;
321 template <
typename KeyType,
typename ValueType>
330 int parent, child, childP1, maxChild;
332 if (record->
value < value)
338 parent = record->
index;
339 child = 2 * parent + 1;
381 child = 2 * parent + 1;
390 child = record->
index;
394 parent = (child - 1) / 2;
419 template <
typename KeyType,
typename ValueType>
424 int parent = (child - 1) / 2;
MinHeap(MinHeap const &minHeap)
MinHeap & operator=(MinHeap const &minHeap)
Record * Insert(KeyType const &key, ValueType const &value)
std::vector< Record * > mPointers
int GetNumElements() const
GLsizei const GLfloat * value
std::vector< Record > mRecords
void Update(Record *record, ValueType const &value)
void Reset(int maxElements)
bool Remove(KeyType &key, ValueType &value)
bool GetMinimum(KeyType &key, ValueType &value) const