Micro Assignment #3 Heap Solution

$30.00

Category:

Description

For this micro assignment, you must implement the following function found inside Heap.h. Note that our heap is a min-heap (smallest items at the top)!

 

void adjustHeap(int index)

 

 

This function causes the item at the supplied index to “percolate down” the heap until the min-heap property is satisfied. Adjust heap is called on deleteMin operations; see the deleteMin function inside Heap class to see how adjustHeap 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).

 

I have tested this code on the EECS SSH server, ssh8. I used the command line:

 

g++ -g -Wall -std=c++0x main.cpp

 

It built (with a couple of warnings) and runs properly.

 

Grading

 

Your submission will be graded based on the following:

 

  1. [10] Your solution builds, does not cause any runtime issues, and passes all test cases

 

 


error: Content is protected !!