Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need BaseStringList, ArrayStringList, and LinkedStringList! Thank you! For this project, you are required to create two different classes that implement the same interface via

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

I need BaseStringList, ArrayStringList, and LinkedStringList! Thank you!

For this project, you are required to create two different classes that implement the same interface via a common abstract parent. While the specific details are listed later in this document, the following diagram illustrates the general relationship between your classes and the interface. The package is provided for you in the cs1302-str-list. jar file which is included in the download for the project (details later). You do not have access to the source code for classes in cs1302. adt. However, you do have access to the byte code and the API documentation website. You will need to use both StringList and Node in your code since depends on (it implements it) and depends on Node . The specific requirements for each class are presented below (See the Suggested Checklist for the suggested order of implementation). - BaseStringList : Create the abstract cs1302.p2. BaseStringList class such that it properly implements a subset of the abstract methods of StringList. Since BasestringList is abstract, it is not mandatory to implement all methods of StringList within this class. The exact list of methods this class must implement are listed in the method section for BaseStringList in the provided UML diagram above. Remember, since BaseStringList is an abstract parent to both ArraystringList and LinkedStringList, its methods must be implemented without reference to the underlying data structure. In other words, within BaseStringList , you cannot use arrays or nodes. The code contained in this class must be general enough to work with both. - Note: The methods that are listed in the UML diagram in BaseStringList must be implemented in that class. You are not allowed to move any of them into ArraystringList or LinkedStringList. You may, however, find that you can more one or more methods from ArrayStringList and LinkedStringList up into BaseStringList. Moving methods up is allowed. In fact, it is encouraged. Any method that you can move up only has to be written once! However, accomplishing this will require some thought. We hope that all of you spend some time trying to ensure that and only contain the methods that absolutely need to be implemented in the child classes! - ArraystringList : Create the cs1302.p2. ArrayStringList class such that it properly extends and fully implements the interface with additional requirements listed below. - You must explicitly define and document a default constructor for this class. The initial size of an is regardless of the list's underlying storage--remember, the list's internal storage and the list itself are two different things. Here is the signature: public ArrayStringList(); - Over the lifetime of an ArrayStringList object, its internal storage may change in order to accomodate more list elements. When your code increases the size of an ArraystringList object's internal array storage, you should actively avoid: i) increasing the array size by one; and ii) doubling the size of the array. Increasing by one is wasteful as it requires making a new array and copying over all elements every time an item is added. Doubling the size of the array may be wasteful at large sizes as there may be many indeces that contain null. Somewhere in between is more reasonable (increasing by 50% ? increasing by 25% ? We'll leave the details up to you). Furthermore, you should not set the initial array size to 0 or to the largest number that is allowed. - LinkedStringList : Create the cs1302.p2.LinkedStringList class such that it properly extends cs1302.p2.BaseStringList and fully implements the cs1302. adt. StringList interface with additional requirements listed below. - You must explicitly define and document a default constructor for this class. The initial size of a is 0 regardless of the list's underlying storage--remember, the list's internal storage and the list itself are two different things. Here is the signature: public LinkedStringList()

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_2

Step: 3

blur-text-image_step3

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

More Books

Students also viewed these Databases questions