In this assignment, you are tasked with creating a queue-like ADT. You will do this using...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this assignment, you are tasked with creating a queue-like ADT. You will do this using a doubly-linked list (DLL) with dummy nodes. You will be presented with a list of methods that must be made with their descriptions. After creating the methods, you will have to write a simple command line interface for the marker to test your ADT. Lastly, you will provide a sequence of commands that the marker can use to explore each of the methods that you created. This sequence is called a demo. The queue-like ADT will consist of nodes containing integers for item type. This will be stored in a first-in-first-out structure but the whole structure can be sorted based on the item values if needed. The basic methods are enqueue and dequeue. Enqueue adds a given item as a new node to the end of the list. Dequeue deletes the first node in the list and returns that node's item. The other methods are described in the Methods Section. Methods 1. Default Constructor - This should initialize an empty doubly-linked list that contains only dummy nodes. The first dummy node should have an arbitrarily small integer as item. The second dummy node should have an arbitrarily large integer as item. 2. Copy Constructor - The should take another queue as a parameter and initialize an exact copy of the provided queue. 3. Is Empty - Return true if the list is empty/ only contains dummy nodes. 4. Print - Prints the contents of the queue in an easily readable way. 5. Enqueue - Takes an integer as a parameter and adds it to the end of the list. 6. Dequeue - Deletes the first node in the list and returns its value. 7. Priority Enqueue - Takes an integer as a parameter and sorted-inserts it into the queue. NOTE: This does not sort the list. It simply adds the new node using a sorted-insert algorithm. 8. Priority Dequeue - Takes an integer as a parameter. Delete the first instance of the integer in the list. 9. Sort - Sorts the list based on the item value of each node. Main Program Your main program should provide a command line interface to interface to interact with your ADT. It must have the option to specifically make use of each of the 9 methods above. In addition, you must print the current queue before taking input from the user. Return the user to input after each method until a q or quit is input. Demo In your README or in a separate file provide a list of commands that can be followed to provide a full tour of your ADT. This tour must involve each of the above methods. Submission Please submit all program files along with a README file that contains the following: Identifying information, Name, Student Number, ect. A brief introduction to the problem. An overview of your code, what does it do, how does it do it, what approach did you use, ect. An explanation of how your code should be compiled and run. Command line instruc- tions is preferred. If this relies on a specific IDE please include information about setup for that IDE. Total Marks: 25 In this assignment, you are tasked with creating a queue-like ADT. You will do this using a doubly-linked list (DLL) with dummy nodes. You will be presented with a list of methods that must be made with their descriptions. After creating the methods, you will have to write a simple command line interface for the marker to test your ADT. Lastly, you will provide a sequence of commands that the marker can use to explore each of the methods that you created. This sequence is called a demo. The queue-like ADT will consist of nodes containing integers for item type. This will be stored in a first-in-first-out structure but the whole structure can be sorted based on the item values if needed. The basic methods are enqueue and dequeue. Enqueue adds a given item as a new node to the end of the list. Dequeue deletes the first node in the list and returns that node's item. The other methods are described in the Methods Section. Methods 1. Default Constructor - This should initialize an empty doubly-linked list that contains only dummy nodes. The first dummy node should have an arbitrarily small integer as item. The second dummy node should have an arbitrarily large integer as item. 2. Copy Constructor - The should take another queue as a parameter and initialize an exact copy of the provided queue. 3. Is Empty - Return true if the list is empty/ only contains dummy nodes. 4. Print - Prints the contents of the queue in an easily readable way. 5. Enqueue - Takes an integer as a parameter and adds it to the end of the list. 6. Dequeue - Deletes the first node in the list and returns its value. 7. Priority Enqueue - Takes an integer as a parameter and sorted-inserts it into the queue. NOTE: This does not sort the list. It simply adds the new node using a sorted-insert algorithm. 8. Priority Dequeue - Takes an integer as a parameter. Delete the first instance of the integer in the list. 9. Sort - Sorts the list based on the item value of each node. Main Program Your main program should provide a command line interface to interface to interact with your ADT. It must have the option to specifically make use of each of the 9 methods above. In addition, you must print the current queue before taking input from the user. Return the user to input after each method until a q or quit is input. Demo In your README or in a separate file provide a list of commands that can be followed to provide a full tour of your ADT. This tour must involve each of the above methods. Submission Please submit all program files along with a README file that contains the following: Identifying information, Name, Student Number, ect. A brief introduction to the problem. An overview of your code, what does it do, how does it do it, what approach did you use, ect. An explanation of how your code should be compiled and run. Command line instruc- tions is preferred. If this relies on a specific IDE please include information about setup for that IDE. Total Marks: 25
Expert Answer:
Related Book For
Posted Date:
Students also viewed these operating system questions
-
ConAir (CA) commercial airlines company requires you experience in database design and have approached you to assist in the design of their new airline database system. They urgently need to have...
-
Management is responsible for establishing effective internal control for its organization, including measures to prevent, deter, and detect fraud. Appendix 7A on pages 294296 describes antifraud...
-
Determine the direction of bond prices over the last year and explain the reason for it.
-
Complete the procedure in Appendix A for reducing a general three-index model to a three-index model with orthogonal indexes.
-
The HARA (for hyperbolic absolute risk aversion) class of utility functions is defined by \[U(x)=\frac{1-\gamma}{\gamma}\left(\frac{a x}{1-\gamma}+b ight)^{\gamma}, \quad b>0\] The functions are...
-
One of Sure-Bet Sherbets best-selling products is raspberry sherbet, which is manufactured in 10-gallon batches. Each batch requires six quarts of raspberries. The raspberries are sorted by hand...
-
Forrest Company manufactures phone chargers and has a policy that ending inventory should equal 20% of the next month's budgeted unit sales. October's ending inventory equals 70.000 units. November...
-
(a) A horizontal steel I-beam of cross-sectional area 0.041m2 is rigidly connected to two vertical steel girders. If the beam was installed when the temperature was 30oC, what stress is developed in...
-
The goal of the Project is to - practice reading UML class diagram and working with interface - practice how to manage and provide sufficient operations on a doubly-linked circular list, for example,...
-
Code Sec. 446 requires the taxpayer's method of accounting clearly reflects income. What does "clearly reflects income" mean?
-
Under what circumstances must a subsidiary recognize gain or loss upon liquidating into its parent?
-
What special tax treatment is available for subdividers of real estate?
-
East Co. redeemed Oscar's stock. Oscar received $20,000 for all the shares he owned. His adjusted basis in the shares was $24,000. Can either party recognize a loss on the redemption?
-
Distinguish between a consent dividend and deficiency dividend.
-
1) Briefly describe the mission of your new business. Please briefly suggest a strategic positioning goal in order to compete with your competitors. Since Managerial Accounting is not a management...
-
Find the image of x = k = const under w = 1/z. Use formulas similar to those in Example 1. y| y = 0 -21 -2 -1 -1, /1 12 T -1 -1 y= -2 x =0
-
Huawei Technologies Co Ltd (in the following called Huawei) is the worlds largest telecom equipment maker (in the B2B market) and Chinas largest telephone- network equipment maker. Huawei was founded...
-
What key internal/external factors influence the organizational structure? Can you think of additional factors? Explain.
-
Mars Inc. is a diversified multifunctional company whose primary products include foods, petcare, confectionery, electronics and drinks. Owned and controlled by the Mars family, this US giant is one...
-
State whether the prediction (or implied prediction) should be trusted in each of the following cases, and explain why or why not. a. Youve found a best-fit line for a correlation between the number...
-
Figure 20 shows data and best-fit lines for both mens and womens world record times in the 1-mile race. Based on these data, predict when the womens world record will be faster than the mens world...
-
Political scientists are interested in knowing what factors affect voter turnout in elections. One such factor is the unemployment rate. Data collected in presidential election years since 1964 show...
Study smarter with the SolutionInn App