lab_heaps
Precarious Priority Queues
Todo List
Member
heap< T, Compare >::empty
() const
Determine if the heap is empty
Member
heap< T, Compare >::hasAChild
(size_t currentIdx) const
Update to return whether the given node has a child
Member
heap< T, Compare >::heap
(const std::vector< T > &elems)
Construct a heap using the buildHeap algorithm
Member
heap< T, Compare >::heap
()
Depending on your implementation, this function may or may not need modifying
Member
heap< T, Compare >::heapifyDown
(size_t currentIdx)
Implement the heapifyDown algorithm.
Member
heap< T, Compare >::leftChild
(size_t currentIdx) const
Update to return the index of the left child.
Member
heap< T, Compare >::maxPriorityChild
(size_t currentIdx) const
Update to return the index of the child with highest priority as defined by
higherPriority()
Member
heap< T, Compare >::parent
(size_t currentIdx) const
Update to return the index of the parent.
Member
heap< T, Compare >::peek
() const
Return, but do not remove, the element with highest priority
Member
heap< T, Compare >::pop
()
Remove, and return, the element with highest priority
Member
heap< T, Compare >::push
(const T &elem)
Add elem to the heap
Member
heap< T, Compare >::rightChild
(size_t currentIdx) const
Update to return the index of the right child.
Member
heap< T, Compare >::root
() const
Update to return the index you are choosing to be your root.
Generated by
1.8.13