Problem

Implement the ADT character string as the classLinkedString by using a linked list of char...

Implement the ADT character string as the classLinkedString by using a linked list of characters. Include the followingLinkedString 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(LinkedStringstr)

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 beginlndex,int endlndex)

Returns a new linked character string that is a substring of this linked character string.

ImplementLinkedString so that it is consistent with theString class. Tor example, character positions 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.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 5
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT