Question
Hi I am really confused about how to even write this code it is getting really hard for me and I am completely lost and
Hi I am really confused about how to even write this code it is getting really hard for me and I am completely lost and would really appreciate help with a full code explained in detail about how and why you implemented certain things.
JAVA: Implement the ADT character string as the class LinkedString by using a linked list of characters. Include the following LinkedString constructors and methods:
-LinkedString(char[] value):
Allocates a new character linked list so that it represents the sequence of characters currently contained in the character array argument.
-LinkedString(String original):
Initializes a new character linked list so that it represents the same sequence of characters as the argument.
-char charAt(int index)
Returns the char value at the specified index. The first character in the linked character string is in position zero.
-LinkedString concat(LinkedString str)
Concatenates the specified linked character string to the end of this linked character string.
-boolean isEmpty()
Returns true if, and only if, length() is 0.
-int length()
Returns the length of this linked character string.
-LinkedString substring(int beginIndex, int endIndex)
Returns a new linked character string that is a substring of this linked character string.
Implement LinkedString so that it is mimics with the String class. For example, character positions should start at zero. Also, keep track of the number of characters in the string; the length should be determined without traversing the linked list and counting.
THREE SEPRATE CLASSES
1) LinkedString Class
The class which defines the LinkedString ADT. This class must implement all of the methods listed in the project specification.
2) Node Class
A class which serves as a template for the objects which make up the Linked List in the ADT LinkedString
3) Test Class
This class should contain a main() method which creates an instance of the LinkedString ADT and invokes each method you have written in the LinkedString class. This must be done to ensure that all of the LinkedString class methods work as specified.
Thank you once again I really apreciate any help to help me learn to better write my programs!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started