formatting source-code for 91c9c96cf4

This commit is contained in:
github-actions 2020-06-23 19:29:12 +00:00
parent 91c9c96cf4
commit 6882b545c7

View File

@ -17,9 +17,9 @@ class MinHeap {
* \param[in] capacity initial heap capacity * \param[in] capacity initial heap capacity
*/ */
explicit MinHeap(int cap) { explicit MinHeap(int cap) {
heap_size = 0; heap_size = 0;
capacity = cap; capacity = cap;
harr = new int[cap]; harr = new int[cap];
} }
/** to heapify a subtree with the root at given index /** to heapify a subtree with the root at given index
@ -49,12 +49,9 @@ class MinHeap {
/** Inserts a new key 'k' */ /** Inserts a new key 'k' */
void insertKey(int k); void insertKey(int k);
~MinHeap() { ~MinHeap() { delete[] harr; }
delete [] harr;
}
}; };
// Inserts a new key 'k' // Inserts a new key 'k'
void MinHeap::insertKey(int k) { void MinHeap::insertKey(int k) {
if (heap_size == capacity) { if (heap_size == capacity) {