Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help, in java programming. Part 1 : Linked List Classes Introduction You are going to write a linked - list class. You will use

Please help, in java programming. Part 1: Linked List Classes Introduction You are going to write a linked-list class. You will use this again in the future. So, do a good job on it, or you will hurt your future assignments. Your classes must be O(1) for all adds and removes. So, you must maintain a reference (link) to the tail. The following is the required interface for the class. This is not a deque, but it has many of the same features. It is a singly linked list. The following is the interface and required methods for your class.
Main class LinkedList Class
String About() Returns text about you the author of this class.
void AddHead(String value) Adds an object to the head of the list. This must be O(1).
void AddTail(String value) Adds an object to the tail of the list. This must be O(1).
String RemoveHead() Removed an object from the head of the list. This must be O(1). If the list is empty, return 0.
Boolean IsEmpty() Returns true if the linked list is empty. In other words, the head is null.
void PrintList() Prints the linked list to standard out (the screen) This method simply calls PrintList() on the Head (if not null)
Part 2: Node Class Overview You are going to create a very, very basic node class. Make sure to come up with a nice, well-documented, and well-written solution. The Node class will contain the recursive method. In recursively defined structures all the coding (and complexity) is found in the recursive structure itself. The logic, for the recursion, must be located within this class. I know, I know, you can implement the logic within the Linked List Class. But, you are not allowed to.
Interface Node Class
Node(String) Constructor
Node Next The next node in the chain.
String Value The value that the node contains. Do not declare it of type "object".
void PrintList() Prints the linked list to standard out (the screen) This method must be recursive.
Part 3: A number of test files will be provided to you for testing your code. The format is designed to be easy to read in multiple programming languages. You need to use the classes, built in your programming language, to read the source files. File Format The first line of the data contains the total digits in the key. You might want to save this value I can be used to separate the key from the value (using the substring function found in most programming languages). Different programming languages implement file IO in different ways. Some use classes and others use more primitive (or ingrained) features. This will take the form of either a While Loop or a Do Loop. In all cases, your main testing class will read the contents of the file and it to a instance of your linked-list class. Do not make this a method in your LinkedList keep it in main().

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

New Trends In Databases And Information Systems Adbis 2019 Short Papers Workshops Bbigap Qauca Sembdm Simpda M2p Madeisd And Doctoral Consortium Bled Slovenia September 8 11 2019 Proceedings

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Robert Wrembel ,Mirjana Ivanovic ,Johann Gamper ,Mikolaj Morzy ,Theodoros Tzouramanis ,Jerome Darmont

1st Edition

3030302776, 978-3030302771

More Books

Students also viewed these Databases questions

Question

Why is the statement of cash flows a useful document?

Answered: 1 week ago

Question

6. Explain the power of labels.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago