Find Jobs
Hire Freelancers

card project

$10-30 USD

Closed
Posted over 6 years ago

$10-30 USD

Paid on delivery
Project description: The program should have a class template that is the implementation of a priority queue. The implementation must be based on building and maintaining heaps based on “highest priorities”, which may be minimum values or maximum values. A single enqueue and a single dequeue function will use a custom comparator to add and remove items from the underlying heap, based on whether a max queue or a min queue is declared. The functionality of the priority queue will be demonstrated by storing instances of a custom class in both decreasing and increasing order. Requirements: 1. Your program must be split into 4 files. There will be a class template, a separate interface and implementation file for a custom class, and a driver file. The requirements for these are specified below: a) The PriorityQueue class template– This class represents a priority queue implemented as a binary heap. It has two type parameters: 1) The type of the element stored in the heap; 2) A comparator class. • Since this is a class template, it will be implemented in a single file which must be named priorityqueue.h • The class must be named PriorityQueue • You should implement the following member functions in the class o A constructor – Resizes the vector representing the heap to hold 50 items. o top – Returns the highest priority item in the heap. Does not change the heap. o dequeue – Has a comparator parameter. Removes the highest priority item in the heap. o enqueue – Has two parameters: 1) the item to be enqueued; 2) the comparator. Enqueues the item and places it in the heap in priority order. o print – Displays the items in the heap, from index 0 through index size-1. o heapUp (private) – Has an index and a comparator parameter and percolates the item up based on its priority. o heapDown (private) – Has an index and a comparator parameter and percolates the item down based on its priority. b) Comparators - There will be two templated class comparators each of which takes a type parameter: one to compare if items are less than or equal to (<=) each other, and one to compare if they’re greater than or equal to (>=). Each of these classes will have a single, public, bool function that returns the result of the above comparisons for two objects of the same type. This function will have the same name in both classes. These functions will be used in the declaration of the priority queues (i.e., as type parameters), and will be defined in the file priorityqueue.h. (Fig 1.24 in the textbook shows a custom comparator class). c) The Card class – This class will be a modified version of the Card class used in Project 4, and will be used to demonstrate the generic nature of the priority queue (its ability to store objects of any type). • Both the interface file (card.h) and the implementation file ([login to view URL]) from that project will be used • The following changes are to be made to the Card class o The <= and >= operators must be overloaded (they may replace < and > overload in that class) o The order (lowest to highest) shall be Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King. The cardFace values of these cards shall be 1 through 13 respectively. o The ostream << overload must output cardFace (rather than pointValue of Project 4). The member pointValue will NOT be used in this project d) A driver, or client, file that • Must be named [login to view URL] • Instantiates both a min priority queue and a max priority queue. • Instantiates an array of the 13 cards in the Spades suit • Shuffles the cards array using std::random_shuffle() • Enqueues the first 7 cards in the max priority queue and displays the heap’s contents after each enqueue
Project ID: 15642317

About the project

9 proposals
Remote project
Active 6 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
9 freelancers are bidding on average $46 USD for this job
User Avatar
I went through the requirements and I would like to do this project if given the opportunity. I have done priority queue before. Let me know if you are interested. Relevant Skills and Experience C++ Programming, Data Structures Proposed Milestones $30 USD - Project Milestone
$30 USD in 1 day
4.9 (1512 reviews)
7.9
7.9
User Avatar
Hi! I'm interesting your project very well. I am mastering c++ and I'm a good algorithmer. And also I have many experience and good skill about data structure. Let's go ahead with me Stay tuned, I'm still working on this proposal.
$30 USD in 1 day
5.0 (256 reviews)
7.1
7.1
User Avatar
I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environment. I made many great projects using c++, for example, I made the tools which could convert java codes into c++ scripts, of course garbage collection included, this was very similar to a compiler, and was very complex. I also made our own mobile game using c++, I can show you the demo of client, if you like. I am very proficient in java also. I have a very good review on Freelancer.com, I never miss a project once I accept the job, you can check my review. Trust me, please let expert help you.
$100 USD in 1 day
4.8 (148 reviews)
7.0
7.0
User Avatar
Hello I'm expert java developer with experience in object oriented, data structure, swing, javafx and more advanced concepts. I can help you to finish this project with great quality. Regards Relevant Skills and Experience java Proposed Milestones $40 USD - m
$40 USD in 2 days
4.9 (397 reviews)
6.6
6.6
User Avatar
Hello. How are you today. I have read and understood this task. Relevant Skills and Experience I have a lots of experience and very good knowledge of Data structures, Algorithms Design, Computer Architecture. And I'm expert in Java, C/C++,C#, Python etc. I'm interested in this project. Proposed Milestones $40 USD - milestone I'll wait for your good reply. Thanks.
$40 USD in 1 day
4.9 (189 reviews)
6.5
6.5
User Avatar
Hello Sir i will do your work and i will assure you a quality work if tiy go with us . Relevant Skills and Experience i am expert in C , C++ , C# , JAVA Proposed Milestones $25 USD - work
$25 USD in 1 day
4.7 (56 reviews)
5.9
5.9
User Avatar
Hi, I've got quite some experience with C++ and I'm sure I can help you out with your project. May I get some more details over the chat? Relevant Skills and Experience C++ Proposed Milestones $50 USD - Completion
$50 USD in 1 day
5.0 (85 reviews)
5.5
5.5
User Avatar
A proposal has not yet been provided
$50 USD in 3 days
4.9 (101 reviews)
5.5
5.5

About the client

Flag of UNITED STATES
United States
0.0
0
Member since Nov 5, 2017

Client Verification

Other jobs from this client

tree project
$10-30 USD
Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.