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 more specificity on the methods. Doliverables: 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 source 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 WORKSI 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%)
Types of Linked List
A sequence of data elements connected through links is called a linked list (LL). The elements of a linked list are nodes containing data and a reference to the next node in the list. In a linked list, the elements are stored in a non-contiguous manner and the linear order in maintained by means of a pointer associated with each node in the list which is used to point to the subsequent node in the list.
Linked List
When a set of items is organized sequentially, it is termed as list. Linked list is a list whose order is given by links from one item to the next. It contains a link to the structure containing the next item so we can say that it is a completely different way to represent a list. In linked list, each structure of the list is known as node and it consists of two fields (one for containing the item and other one is for containing the next item address).
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images