You are to implement an interactive dynamic single Linked List structure. This List will be based on the node definition given on the next page. Since you already know how to create classes, this...


You are to implement an interactive dynamic single Linked List structure. This List will be based on<br>the node definition given on the next page. Since you already know how to create classes, this<br>should be a logical extension. Your goal is to create a Linked List class which contains

Extracted text: You are to implement an interactive dynamic single Linked List structure. This List will be based on the node definition given on the next page. Since you already know how to create classes, this should be a logical extension. Your goal is to create a Linked List class which contains "node" elements. Your program should contain the ability to dynamically (meaning the user can select what each choice at anytime): 1. Insert at head (new node at head) 2. Insert at tail (new node placed at the end of the list) 3. Print (prints out the contents of the list in order) 4. Remove from head (remove first node) [watch special case]] 5. Remove from tail (remove last node) [watch special cases] 6. Find a target value (an isThere routine) (tells you if the target is in the list) 7. Give total # of occurrences of a specified value (how many items of target are in the list) 8. Give a total # of nodes (total items in list) This program will track integers from the user. Be aware that some of these methods above will force you to create other routines/methods. You are coding dynamic structures - code accordingly. See page 2 for moro specificity on the methods. Deliverables: 1) Clearly documented, professionally written source code (in a running form) 2) 3 runs showing all the user menu items. (output) (screenshots are fine) 3) Grading is based on: a) Meets all requirements (80%) b) Quality of sourco code (comments, logic, pre/post conditions, etc.) (20%) For extra credit, you may do the following: (will require research on your own) [DO NOT DO THIS UNLESS YOUR PROGRAM ALREADY FULLY WORKS] 1) Upgrade the "insert" method to allow for a "variable location insert". (this isn't easy) (5%) 2) Attempt to make 1 or more of the methods recursive. (5%)
Specifics:<br>1) Your submission (source code):<br>a. For this project, you may keep your class definition in the same file as the driver -<br>however, you need to start thinking about importing

Extracted text: Specifics: 1) Your submission (source code): a. For this project, you may keep your class definition in the same file as the driver - however, you need to start thinking about importing "packages" – see pages 60-65 in the book. 2) Class construction – my suggestion is to use something similar to the following: public class Node ( public class Linked_ list { private int data; private Node head; private Node next; 3) DO NOT use any built in "linked list" methods from java. You are to write the code for "insert", "print", etc. In other words, the logic of how it will be done is to be coded by you. DO NOT import in any classes or methods from any other source - you need to code this yourself. If you aren't sure what I mean, ask before you codel 4) You may use (import) standard io methods (get inputs from the user, write to screen, etc.) as well as methods to do basic error checking (e.g, an islnteger type method) 5) Class methods - node. Much of this is already given to you in chapter 4- you do not have to put in all the methods that the book shows - just include the ones that you need to fulfill the requirements. Start with the node class definitions first. Make sure they work before you move onto the Linked List class. Remember, when you designing this class, think about how it will be accessed by the Linked list class. 6) The linked list class is a simple extension of the node class; essentially just a head pointer. Remember, when you design this class, think about how the main (driver) program will access this class, and how this class will access the node methods. 7) Don't duplicate work done by the node class in the linked list classl In many cases, the linked list could simply call the Node methods and pass data. Use common sense constructors and methods - include an empty case constructor as well as a 1 variable constructor. At this point you DO NOT need to do all the traditional "sets" and "gets" - BUT, some of them will be needed to do this program. 8) Ultimately, you should end up with 3 "classes"; a node class, a linkedlist class, and the main (follow class requirements on naming conventions). Although you can have all three in the same file, you may want to separate them (a node file, linked list file, and of course your driver or main file). You will be able to reuse some of this code for future programming assignments so modularity now will help you out a lot later. 9) Your program should present the "user" a menu of choices (i.e. the "abilities" list on the first page). Ensure you do basic error checking in inputs, AND, think through the logic on empty cases or special cases; ie. do NOT let the user crash your program by a series of random inputs.
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here