computer science homework

profileJoshuaTT

The main task is to implement two priority queues. All two implementations should implement

the provided PriorityQueue interface (include implements PriorityQueue in your Java code),

which means they should work with priorities that have type double and there are no

corresponding items attached to the priorities. Your implementations should be as follows:

• A class BinaryHeap that implements a binary min-heap as we discussed in class, using

an array to store the conceptual complete tree.

• A class ThreeHeap that implements a min-heap where each non-leaf node has 3 children.

You should still use a contiguous portion of an array to store the conceptual complete

tree. We suggest you make a copy of your BinaryHeap class and make changes as

necessary.

Put your two implementations in two separate Java files, BinaryHeap.java and ThreeHeap.java. 

See more detial in the attachments.

 

  • 9 years ago
  • 50
Answer(1)

Purchase the answer to view it

blurred-text
  • attachment
    cps_350_assignment_41.zip