1. Write a new method, equals, as part of the SimpleArrayList class. Here is the method header: public boolean equals ( Object ob ) The equals method should return true iff parameter ob is a List and the SimpleArrayList and ob contain the same elements in the same order. Two elements e1 and e2 are the same iff they are both null or e1.equals(e2). (You can use Java's instanceof operator to test whether ob is a List.) public boolean equals ( Object ob ) { if(ob == null || !(ob instanceof List)) // O(1) return false; if(!(((List)ob).size() == numItems)) // O(1) return false; for(int i=0;i< numItems; i++) { Object e1, e2; e1 = items[i]; e2 = ((List)ob).get(i); // O(1) assuming get(i) is O(1) if(!(e1==null ? e2 == null : e1.equals(e2))) // O(1) return false; } return true; } 2. Write an equivalent method as part of the SimpleLinkedList class. public boolean equals ( Object ob ) { if(ob == null || !(ob instanceof List)) // O(1) return false; if(!(((List)ob).size() == numItems)) // O(1) return false; Listnode n = items; for(int i=0;i< numItems; i++) { n = n.getNext(); Object e1, e2; e1 = n.getData(); e2 = ((List)ob).get(i); // O(1) assuming get(i) is O(1) if(!(e1==null ? e2 == null : e1.equals(e2))) // O(1) return false; } return true; } 3.Using Big-O notation, give the worst-case time complexity for each of your equals methods. If you use one or more variables (e.g., N, M), be sure to say what those variables measure. Write a brief justification for the time complexities you give. Include in your justification assumptions you make about the complexity of any methods that are called by your method. -- equals, as part of the SimpleArrayList class: Worst-case time complexity is O(N) where N is the number of elements in the SimpleArrayList. Assuming that get(i), equals(), size() methods called within the method is O(1), all other statements are O(1) as indicated. Since there is a loop which executes N times and has constant time operations within, the total worst-case time complexity is O(N). -- equals, as part of the SimpleLinkedList class: Worst-case time complexity is O(N) where N is the number of elements in the SimpleLinkedList. Assuming that get(i), equals(), size(), getNext(), getData() methods called within the method is O(1), all other statements are O(1) as indicated. Since there is a loop which executes N times and has constant time operations within, the total worst-case time complexity is O(N).