Question
(Java) convert the array method in the code give below into a Linked LIst. ---- class StringList{ private int size; private int count; private String
(Java)
convert the array method in the code give below into a Linked LIst.
----
class StringList{ private int size; private int count; private String List[]; public StringList(){ this.size=10; List=new String[size]; count=0; } public StringList(int size){ this.size=size; List=new String[size]; count=0; } public boolean isEmpty(){ return count==0?true:false; } public boolean isFull(){ return count==size?true:false; } public int size(){ return count; } public void clear(){ count=0; } public String StringRetrieve(int position){ if(position<0||position>count){ throw new RuntimeException("Invalid Position"); } return List[position]; } public void StringReplace(String newStr,int position){ if(position<0||position>count){ throw new RuntimeException("Invalid Position"); } List[position] = newStr; } public void StringRemove(int position){ if(position<0||position>count){ throw new RuntimeException("Invalid Position"); } for(int i=position;i
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