private void bubbleUp() {
        int cur = this.size - 1;      // Location of last item added
        int parent = (cur - 1) / 2;  // Parent of the new item

        // We only need to check heaps with more than 1 element
        if (this.size > 1) {
            // Walk up the heap until you reach the top or stop finding
            // values that are out of place
            while (parent >= 0 && this.heap[cur] > this.heap[parent]) {
            // Swap the parent and child values
                int temp = this.heap[cur];
                this.heap[cur] = this.heap[parent];
                this.heap[parent] = temp;

                // Move up one level in the heap
                cur = parent;
                parent = (cur - 1) / 2;
            }
        }
        
    }