Question: Project 1 (in CH): Linked-list implementation of Stack, Queue, and ordered list (in ascending order). The operations include insertion, deletion and print The input file

 Project 1 (in CH): Linked-list implementation of Stack, Queue, and ordered
list (in ascending order). The operations include insertion, deletion and print The
input file contains a list of pair (op, data>) where op is
either or where means insert - means delete, and data is a
positive integer. For example, +20, means insert 20,-20 means delete 20. Your

Project 1 (in CH): Linked-list implementation of Stack, Queue, and ordered list (in ascending order). The operations include insertion, deletion and print The input file contains a list of pair (op, data>) where op is either or where means insert - means delete, and data is a positive integer. For example, +20, means insert 20,-20 means delete 20. Your program will construct a stack, then, a queue and then, an ordered list, all in linked list implementations, Reading from the input pairs, your program will perform operations, given by the pairs, on the Stack. Then, reading the sume input pairs, your program will perform operations on a queue, then do the same on an ordered list. ** For Stack and Queue, the data after the is not used. setee. Language: CHICHTutorial and CH project Tutorial are posted in Google Classroom Project points: 10 pts Due Date: Softcopy.zip) and hard copies.pdb: 02/10/2021 Wednesday before midnight -1 for 1 day late: 2/11/2021 Thursday before midnight -2 for 2 days late: 2/12/2021 Friday before midnight -10/10:2/12/2021 Friday after midnight *** Name your soft copy and hard copy files using the naming convention as given in the project submission requirement discussed in a lecture and is posted in Google Classroom. *** All on-line submission MUST include Soft copy (zip) and hard copy (pdf) in the same email attachments with correct email subject as stated in the email requirement, otherwise, your submission will be rejected. see .... L Input (use argv[1]): a text file contain a list of pair { NULI. Per - LIQueue class - listNode" head / head always points to the dummy node! - listNode tail / till always points to the last node of the queue; tuil points to dummy initially. Methode constructor (.) creates a new Queve with a dummy node, set the data in the dummy node to -9999 and sets next to null; let both head and tail point to the dummy node - buildQueue (inFile) // see algorithm below. Implement all other Queue operations on your own. ** Use the following queue operations in build. You may add other operations as needed - Int(new Node) // insert the new Node after the tail of Node deleteQ...) Wir is not empty, delete the first mode, after the dummy from und ums the Il deleted node, otherwise, turns null -bool imply ...) checks to see if is empty.ie, tail points to the dummy node. It reus true is in empty and Gale otherwise priuil2) DO NOT delete nodes in Queel Outputs to cut File2, the entire, including the dummy mode, you may calling printNode (...) using the following format: www. (dal MULL) --11----01 7, NULLON LL Biode listed always points to the dummy node Methode - mate w list with a dummy od set the data is the commode 29 and let listed points to the dumy wade - build (in) sex porihm dlow. Implement all other list operations on your own Uw the following users in build. You may did other operations needed - Benewede) Use the site from the bare not - Tode desen Node (data) First searches and is the lathat containe datif such made it delete the code frees the listed Game the deleted node, otherwise, tell prout Outlets including the dummy node, by calling mele.) until the end of the listing de following format: -listict (WNO - Node deleten Node (data) // Fint, searches a mode in the list that contains data; if wuch node exit deletes the node from the list and returns the deleted node, otherwise, returns null -print.lint (outFileOutput to wulfile, the entire list, including the dummy bode, by calling pintNode.) until at the end of the list, using the following format: - '). NULLA NULL re NT, NULL) NULL . IV.main( Step 0: in file open from argyll entFiel, omf 1162, outile) + open from argyl2). argve 21. argv[4). Step 1: buildStack (inFile, outFilel) // Algorithm tops is given below Step 2: close in File Step 3: re-open in File Step 4: buildQueue (inile, outFile2) W Algorithm steps is given below Step 5: close in File Step 6: re-open inFile Step 7: buildList (inFile, outFile3) Algorithm steps is given below Step 8: close all files V.buildStack File, outFilel) Step 0: Use Suck constructor to establish a stack Step 1: op, data read the pair from inFile outilel output op, data write description Step 2: fop- newNode + get a listNode with data /Use listNode constructor Push (new Node) W pot new Node onto the top of the stack Else if op jank - Pop 0 if junk is not all free junk the outputs to outlel a message the Stack is empty. Step 1: printStackout Filel) Step repeat pl to spuntinFile is empty. VL, le 2) Sep 0:0 LLOor to establish a queue, with head and wil Step 1: op, data read the pair from inte puto, data wile description Step 2: op new ideas lode with data w Use lode constructor Node) in the new Node alter the ball of case if op Junk dello If not all Free punk che outputs to the cathe Queimply Step.print2) Step repeat pleep until inFile la amply Step 4: repeat step I to step until inFile is empty es VL buildQueueinFile, outFile2) Step 0:Q Use LLQueue constructor to establish a queue, with head and tail. Step 1: op, data read the pair from inFile outFile2 output op, data // write description Step 2: ifop-*** newNode get a listNode with data // Use listNode constructor insertQ (newNode) Winsert the new Node after the tail of Q: else if op Junk delete 0 If junk not null Free junk else outputs to outFile2 a message: the Queue is empty Step 3.print(outFile2) Step 4: repeat step I to step 3 until inFile is empty. VII. build ListinFile, outFile3) Step O: listHead Use LList constructor to establish a Llist Step 1: op, data read the pair from inFile outFile3 output op, data // write description Step 2: if op newNode get a listNode with data // Use listNode constructor listinsert(new Node) else if op - Junk deleteOneNode (data) if junk not null Free junk else outputs to outfiled a message the data is not in the list Step 3: printList (outFile3) Step 4: repeat step to step 3 until inFile is empty Pseudo Code is given please Solve it in CH Project 1 (in CH): Linked-list implementation of Stack, Queue, and ordered list (in ascending order). The operations include insertion, deletion and print The input file contains a list of pair (op, data>) where op is either or where means insert - means delete, and data is a positive integer. For example, +20, means insert 20,-20 means delete 20. Your program will construct a stack, then, a queue and then, an ordered list, all in linked list implementations, Reading from the input pairs, your program will perform operations, given by the pairs, on the Stack. Then, reading the sume input pairs, your program will perform operations on a queue, then do the same on an ordered list. ** For Stack and Queue, the data after the is not used. setee. Language: CHICHTutorial and CH project Tutorial are posted in Google Classroom Project points: 10 pts Due Date: Softcopy.zip) and hard copies.pdb: 02/10/2021 Wednesday before midnight -1 for 1 day late: 2/11/2021 Thursday before midnight -2 for 2 days late: 2/12/2021 Friday before midnight -10/10:2/12/2021 Friday after midnight *** Name your soft copy and hard copy files using the naming convention as given in the project submission requirement discussed in a lecture and is posted in Google Classroom. *** All on-line submission MUST include Soft copy (zip) and hard copy (pdf) in the same email attachments with correct email subject as stated in the email requirement, otherwise, your submission will be rejected. see .... L Input (use argv[1]): a text file contain a list of pair { NULI. Per - LIQueue class - listNode" head / head always points to the dummy node! - listNode tail / till always points to the last node of the queue; tuil points to dummy initially. Methode constructor (.) creates a new Queve with a dummy node, set the data in the dummy node to -9999 and sets next to null; let both head and tail point to the dummy node - buildQueue (inFile) // see algorithm below. Implement all other Queue operations on your own. ** Use the following queue operations in build. You may add other operations as needed - Int(new Node) // insert the new Node after the tail of Node deleteQ...) Wir is not empty, delete the first mode, after the dummy from und ums the Il deleted node, otherwise, turns null -bool imply ...) checks to see if is empty.ie, tail points to the dummy node. It reus true is in empty and Gale otherwise priuil2) DO NOT delete nodes in Queel Outputs to cut File2, the entire, including the dummy mode, you may calling printNode (...) using the following format: www. (dal MULL) --11----01 7, NULLON LL Biode listed always points to the dummy node Methode - mate w list with a dummy od set the data is the commode 29 and let listed points to the dumy wade - build (in) sex porihm dlow. Implement all other list operations on your own Uw the following users in build. You may did other operations needed - Benewede) Use the site from the bare not - Tode desen Node (data) First searches and is the lathat containe datif such made it delete the code frees the listed Game the deleted node, otherwise, tell prout Outlets including the dummy node, by calling mele.) until the end of the listing de following format: -listict (WNO - Node deleten Node (data) // Fint, searches a mode in the list that contains data; if wuch node exit deletes the node from the list and returns the deleted node, otherwise, returns null -print.lint (outFileOutput to wulfile, the entire list, including the dummy bode, by calling pintNode.) until at the end of the list, using the following format: - '). NULLA NULL re NT, NULL) NULL . IV.main( Step 0: in file open from argyll entFiel, omf 1162, outile) + open from argyl2). argve 21. argv[4). Step 1: buildStack (inFile, outFilel) // Algorithm tops is given below Step 2: close in File Step 3: re-open in File Step 4: buildQueue (inile, outFile2) W Algorithm steps is given below Step 5: close in File Step 6: re-open inFile Step 7: buildList (inFile, outFile3) Algorithm steps is given below Step 8: close all files V.buildStack File, outFilel) Step 0: Use Suck constructor to establish a stack Step 1: op, data read the pair from inFile outilel output op, data write description Step 2: fop- newNode + get a listNode with data /Use listNode constructor Push (new Node) W pot new Node onto the top of the stack Else if op jank - Pop 0 if junk is not all free junk the outputs to outlel a message the Stack is empty. Step 1: printStackout Filel) Step repeat pl to spuntinFile is empty. VL, le 2) Sep 0:0 LLOor to establish a queue, with head and wil Step 1: op, data read the pair from inte puto, data wile description Step 2: op new ideas lode with data w Use lode constructor Node) in the new Node alter the ball of case if op Junk dello If not all Free punk che outputs to the cathe Queimply Step.print2) Step repeat pleep until inFile la amply Step 4: repeat step I to step until inFile is empty es VL buildQueueinFile, outFile2) Step 0:Q Use LLQueue constructor to establish a queue, with head and tail. Step 1: op, data read the pair from inFile outFile2 output op, data // write description Step 2: ifop-*** newNode get a listNode with data // Use listNode constructor insertQ (newNode) Winsert the new Node after the tail of Q: else if op Junk delete 0 If junk not null Free junk else outputs to outFile2 a message: the Queue is empty Step 3.print(outFile2) Step 4: repeat step I to step 3 until inFile is empty. VII. build ListinFile, outFile3) Step O: listHead Use LList constructor to establish a Llist Step 1: op, data read the pair from inFile outFile3 output op, data // write description Step 2: if op newNode get a listNode with data // Use listNode constructor listinsert(new Node) else if op - Junk deleteOneNode (data) if junk not null Free junk else outputs to outfiled a message the data is not in the list Step 3: printList (outFile3) Step 4: repeat step to step 3 until inFile is empty Pseudo Code is given please Solve it in CH

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!