Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

Data Abstract Structures Labuild a Max Heap CPP Project

Data Abstract Structures Labuild a Max Heap CPP Project

I don’t know how to handle this Computer Science question and need guidance.

10.6 Lab: Heap – Build a max-heap (of integers)

This program will read integers from the keyboard, insert them into a max-heap, and display them as they are deleted from the heap. Most of the code is given:

  • Heap.h
  • Heap.cpp
  • main.cpp

Your task is to finish defining four function in Heap.cpp:

  • insertHeap
  • deleteHeap
  • _reHeapUp
  • _reHeapDown

10.7 Lab: Heap – Build a min-heap (of integers)

Change the previous lab to work with a min-heap instead of a max-heap.

This program will read integers from the keyboard, insert them into a min-heap, and display them as they are deleted from the heap. Most of the code is given:

  • Heap.h
  • Heap.cpp
  • main.cpp

Your task is to finish defining four function in Heap.cpp:

  • insertHeap
  • deleteHeap
  • _reHeapUp
  • _reHeapDow

10.8 Lab: Heap – Display Heap as an Indented List

Change the previous lab to display a min-heap as an indented list (level numbers included). In order to do this you will have to add two new member functions of the heap class

<code> - void _printIndented(int index, void visit(int, int)); // A - void printIndented(void visit(int, int)); // B </code>

None: One function would be sufficient(A). However, to make the call simpler, a wrapper function (B) has been added (to “hide” the root of the heap).

10.9 Lab: Heap – Build min/max-heaps (of integers)

Generalize one of the previous labs to build a min-heap or a max-heap using the same heap functions. Hint: a pointer to a compare function. In main() you are passing either compareMin or compareMax to the insertHeap function:

<code>minHeap.insertHeap(num, compareMin);maxHeap.insertHeap(num, compareMax);</code>

You also have to update the following functions in the Heap class:

<code>bool insertHeap(int itemIn);bool deleteHeap(int &itemOut);void _reHeapUp(int lastndx);void _reHeapDown(int rootndx);</code>

This program will:

  • read integers from the keyboard and insert them into a min-heap and a max-heap
  • display the integers as they are deleted from the min-heap.
  • display the integers as they are deleted from the max-heap.

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: School Assignment only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by School Assignment are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. School Assignment is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At School Assignment, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.