Micro Assignment #4 Heap PercolatingFor 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 were being good programmers and allowing the heap to percolate down at any point, not just the root! Doing soallows 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, ssh8. I used the command line:g++ -g -Wall -std=c++0x main.cppYou can run this with make, make test, and make run as per usualIt built and runs properly. The tests for insert and delete currently fail, which is what youre going to fix.GradingYour submission will be graded based on the following:1. [10] Your solution builds, does not cause any runtime issues, and passes all test cases
5/5 – (5 votes)
Reviews
There are no reviews yet.