1. Engineering
  2. Computer Science
  3. please use the implementation above and the code below to...

Question: please use the implementation above and the code below to...

Question details

Quiz201.java 1 class Node 2 3 String value; Node next; 4 public Node(String value, Node next) this.value = value; this.next next; 10 public class LinkedStringList implements StringList 12 Node front; 13 14 15 I1 How will we construct it? 16 public LinkedStringlist) 17 18 19 20 1I How will we implement the methods? 21 public void prepend(String s) f int size; this.front new Node(null, null); Node newFront new Node (s, this.front.next); this.front.nextnewFront; this. size 1; 23 24 25 26 27 public String get(int index) 28 29 30 31 32 Node current this.front.next; for(int í = 0; i< index ; i+= 1) { current current.next; return current.value; 34 35 public void add(String s) Node current this.front; current = current.next; 37 38while(current.next null) 39 40 41 current.next new Node(s, null); 42 this . size 1;
45 public void remove(int index) 46 47 48 49 50 51 52 53 public void insert (int index, String s) 54 Node current this.front; for(int í= 0; i< index ; i+= 1) { current = current.next; current . next current . next. next ; = Node current this. front; for(int i=0; i< index ; i+= 1) { 56 57 58 59 60 61 public int size) 62 63 64 65 current current.next; current.next new Node(s, current.next) return this.size;
Please use the implementation above and the code below to answer question 2. Please explain it well.

LinkedStringList groceryList -new LinkedStringList0: groceryList.add Bananas) groceryList.add Milk) groceryList.add(Egg#7; groceryList addfCheetohs 2. How many Node objects are created? 1 point 05
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution