[Solved] CPE202 Lab 7 Implement a MaxHeap class

$25

File Name: CPE202_Lab_7__Implement_a_MaxHeap_class.zip
File Size: 367.38 KB

SKU: [Solved] CPE202 Lab 7 – Implement a MaxHeap class Category: Tag:
5/5 - (1 vote)

Implement a class MaxHeap (a max heap) that can contain any items that can be compared using the standard comparison operators (<, >, <=, >=, ==)

The following starter files are available on GitHub. Complete the implementations and ensure that your implementations are committed and pushed to GitHub.

  • py
  • py

Clarifications and corrections:

  • The peek and dequeue methods should return None if the heap is empty
  • the heap_sort_ascending method should sort the list that is passed in as a parameter and does not need to return anything. The test case given to you (test_11) incorrectly tests that the return value is a sorted list and instead should check if the list passed in is now sorted.
  • The build_heap method does not need to return anything. You can remove the test inside of test_04 that checks the return value.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CPE202 Lab 7 Implement a MaxHeap class
$25