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

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

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 refer to the implementation above and the code below to answer the following question 1.

ArrayStringList months new ArrayStringList0 months.add-January): months.add( February) months.addMarch months.add(Apni months.add May months.addJune) months.add July months.add( August months.addSeptember months.add( October) months.add( November) months.add( December 1. What is the value of months.elements.length after this pon code runs? O 12 O 13 O 16 O 24 32
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution