Find Jobs
Hire Freelancers

queue libraries

$15-20 USD

已完成
已发布大约 22 年前

$15-20 USD

货到付款
contd... All your classes should have separate header (.h) files and separate implementation files. Part of your assignment is also to write a Makefile to compile your program correctly. You can assume that the main file using your program is always going to be main.C. The Makefile should have three different targets that build the program differently: normal - build a normal executable just including the library code into the compilation. This is the way you have been doing it until now. static - build a static source library archive, (.a) file, for your library and link it with the provided main.C. shared - build a shared object library, (.so) file, for your library and link it with the provided main.C. Make sure that all your operators and function calls match exactly the specifications. Since our main program will be making the calls they will have to match otherwise they will not work. The provided sample main is only a sample and is not a complete test case by any means. You must call your library implementation file queue.C. A library header file containing the class definition and the prototypes for your functions must be in queue.h. ## Deliverables In this assignment you will design and code the functions for a library of queues. Your library will create and perform several useful functions on queues. You will implement this library with a class. The name of your class MUST be queue. You are free to choose how to implement this library, so long as it matches the specifications given. Note that you are writing the library ONLY. Your code will not have a main. Here is a sample main.C. Do not submit this file. Your library will be tested with this main, as well as many others. The elements in the queue you will be creating are integers. A queue can contain any number integers, or none at all. The order of integers in the queue is important. Also, a queue can contain many instances of a number. The queues are FIFO queues. This means that the first elements in the queue are the first ones to be removed from the queue. Your library must follow these specifications: Allow user to create objects of type queue, both empty and nonempty. Format: queue data; /* Empty queue */ Format: queue data(A, 5); /* A is an int[], 5 is the number of elements in A to add to data in the same order they appear in the array. So the elements added would be A[0]..A[4]. There will always be enough values in the array */ Allow copying of a queue to an other one of two ways: copy constructor: queue * qp = new queue(data); or operator: queue q = data; Allow values in a queue to be added or removed Format: [login to view URL](A, 2); /* A is an int[], 2 is the number of elements to add to the queue data from A. Same as above A[0]..A[1] would be added to the end of the queue data. */ Format: [login to view URL](2); /* 2 is the number of elements to remove from the beginning of the queue data. */ Allow comparison operations on objects of type queue The following must be supported: Format: (data and test are of type queue ) if (data == test) ... Note: Comparisons on queues works in the following way: A B : The elements of queue A match exactly the elements of queue B, including the order of the elements. A B : The elements of queue A do not exactly match the elements of queue B, may differ only in order of the elements. A B : Every element in queue A is in queue B. Queue B might contain elements not in queue A. A B : Every element in queue A is in queue B. Queue B must contain additional elements not found in A. Allow cout of a queue (Do not just printout numbers, print the data in the order from oldest to newest separated with a comma, i.e. 1,2,3 would mean that 1 is the next to be removed and 3 was the last to have been added) Format: cout ``The content of the queue is '' data endl; Implement the following additional operators: queue union C = A + B. C contains the elements queue A, followed by the elements in queue B. Self assignment union A += B. Since we have + and = operators += will not be hard to implement. queue intersection C = A && B. C contains the elements that are contained in both queues. (multiple appearances of an element only if there are multiple appearances in both queues.) queue shuffle C = A * B. C contains only elements of queue A shuffled with the elements of B. ( C = { a1, b1, a2, b2, a3, b3, ...} ). If one queue has more elements than the other once all the elements from the queue with less elements have been added, all elements from the larger queue should be added. queue difference C = A / B. C contains the elements from queue A that do not appear in queue B any number of times. queue length (has to be called length) int = [login to view URL](); Where data is of type queue. Your queue class must have a correct memory management. If a queue is deleted all of its memory is to be deleted. This time we will make sure it works correctly. The queue class must be implemented by use of inheritance from a linked list class, i.e. you will most likely end up with 3 classes. contd... ## Platform unix environment in c++ with g++ compiler
项目 ID: 2842587

关于此项目

10提案
远程项目
活跃22 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
See private message.
$17 USD 在14天之内
5.0 (60条评论)
5.0
5.0
10威客以平均价$15 USD来参与此工作竞价
用户头像
See private message.
$12.75 USD 在14天之内
4.4 (71条评论)
5.5
5.5
用户头像
See private message.
$17 USD 在14天之内
4.7 (48条评论)
4.3
4.3
用户头像
See private message.
$5.95 USD 在14天之内
4.3 (24条评论)
4.3
4.3
用户头像
See private message.
$16.15 USD 在14天之内
5.0 (33条评论)
4.0
4.0
用户头像
See private message.
$17 USD 在14天之内
4.7 (18条评论)
4.0
4.0
用户头像
See private message.
$17 USD 在14天之内
5.0 (3条评论)
1.8
1.8
用户头像
See private message.
$17 USD 在14天之内
4.0 (2条评论)
0.5
0.5
用户头像
See private message.
$17 USD 在14天之内
0.0 (0条评论)
0.0
0.0
用户头像
See private message.
$12.75 USD 在14天之内
0.0 (0条评论)
0.0
0.0

关于客户

UNITED STATES的国旗
United States
5.0
2
会员自2月 21, 2002起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。