Micro Assignment #4 – Heap Percolating
For this micro assignment, you must implement the following functions found inside Heap.h.
Note that our heap is a min-heap (smallest items at the top)!
void percolateDown(int index)
void percolateUp(int current_position)
These functions cause the items at the supplied locations to “percolate down” and “percolate up†the heap until the min-heap property is satisfied. percolateDown is called on deleteMin operations; see the deleteMin function inside Heap class to see how percolateDown is called. Note that we’re being good programmers and allowing the heap to percolate down at any point, not just the root! Doing so allows us to evoke the percolate down functionality in other situations (e.g. buildHeap).
The percolateUp function is called on insert() calls and moves any given index up in the tree until it satisfies the heap properties of our min heap.
I have tested this code on the EECS SSH server. I used the command line:
g++ -g -Wall -std=c++11 main.cpp
You can run this with ‘make’, ‘make test’, and ‘make run’ as per usual
It built and runs properly. The tests for insert and delete currently fail, which is what you’re going to fix.
Grading
Your submission will be graded based on the following:
- [10] Your solution builds, does not cause any runtime issues, and passes all test cases
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!
NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

