CISS 350 Programming Assignment 7 Compare Two Implementations of a Priority Queue

Programming Assignment 7
Your assignment is to write and compare two implementations of a priority queue whose highest priority element is the one with the smallest key value. The elements have the following declarations:

  1. The first implementation uses a minimum heap. You need to modify the heap operations to keep the minimum, rather than maximum, element in the root. The comparison function should compare key fields.
  2. The second implementation uses a linear linked list, whose elements are ordered by key value.

Test Data
Create a data set that contains 50 items with priorities generated by a random-number generator.

Comparing the Implementations
To compare the operations, you must modify the Enqueue and Dequeue operations to count how many elements are accessed (compared or swapped, in the case of reheaping) during its execution.
Write a driver to Enqueue and Dequeue the 50 test items and print out the number of elements accessed for the Enqueue and Dequeue operations. Run your driver once with each implementation.

Deliverables

  • A listing of specification and implementation files for both priority queue implementations
  • A listing of your driver
  • A listing of your test data
  • A listing of the output from both runs
  • A report comparing the number of elements accessed in executing each operation.



This slideshow requires JavaScript.


This assignment includes a Visual Studio (c++) project

  • Attachments
    • CISS_350_Programming_Assignment_7.zip (4.40 MB)
      • CISS350-Programming-Assignment-7-Output.png
      • CISS350-Programming-Assignment-7-Screenshot.png
      • CISS350-Programming-Assignment-7-Thumb.png
      • Visual Studio C++ Project
        • CISS350Assignment7
          • CISS350Assignment7
            • CISS350Assignment7.cpp
            • CISS350Assignment7.vcxproj
            • CISS350Assignment7.vcxproj.filters
            • Debug
              • CISS350A.CEB550EF.tlog
                • CISS350Assignment7.lastbuildstate
              • CISS350Assignment7.obj
              • CISS350Assignment7.pch
              • stdafx.obj
              • vc120.idb
              • vc120.pdb
            • ReadMe.txt
            • Report.out
            • stdafx.cpp
            • stdafx.h
            • targetver.h
            • Test.dat
          • CISS350Assignment7.opensdf
          • CISS350Assignment7.sdf
          • CISS350Assignment7.sln
          • CISS350Assignment7.v12.suo
          • Debug
            • CISS350Assignment7.exe
            • CISS350Assignment7.ilk
            • CISS350Assignment7.pdb
          • ipch
            • ciss350assignment7-15bb52f8
              • ciss350assignment7-8c9bcc6.ipch
    Preview random excerpt
    xxxxx xxxxxxxxx xxx;
    xxxxxxx xxxxxx xxx{
    xxx xxx;
    xxx *xxxx;
    }
    xxxx
    ; int
    x
    ; //
    xxxxxx
    xxxxx
    int a[
    xxxxxxx
    ]; //
    xxxxx
    all item input int MinHeap[MaxSize]; // define min
    xxxx
    int Nheap; //
    xxxxxx
    xxxxx
    current
    xx
    heap Node *
    xxxx
    ; //
    xxxxxx
    linear linked list whose
    xxxxxxxx
    are ordered by key value ofstream
    xxxx
    (
    xxxxxxxxxx
    ); //
    xxxxxxx
    means
    xx
    add an item to the queue, generally at the "back" of
    xxx
    queue. This
    xxx
    sometimes be called "push" // numsteps
    xx
    number steps
    xxxxx
    to Enqueue void Enqueue(int key, int &
    xxxxxxxx
    ){
    xxx xxxxx, xxxxxx;
    //xxxxxxxx xxxx xx xxxx
    xxxxx++;
    - - - more text follows - - -



Purchasing Instruction
List Price: $19
Buy Now

Add to Cart

FLASH SALE

$89

$113 Save $24
CISS350 Entire Course