3.1
Implement the following methods on strings. Make efforts to avoid creating temporary objects if possible.
public static String reverse (String s)
Return the reverse of the string s.
public static boolean symmetric(String s)
Return true if s is symmetric and false otherwise. A string is symmetric if its reverse is the same as itself.
3.2
Add the following methods to the MyLinkedList
public E[] toArray()
Returns an array containing all of the elements in this list in the correct order.
public int lastIndexOf(E o)
Returns the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element. More formally, returns the highest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
public void remove(E o)
Remove the first occurrence of o. Use equals to test equality of objects.
3.3
Design and implement a class for students' attendance lists. Each student has a name, a SSN, and a counter that tells the number times the student has attended the class. The user of an attendance list should be able to add new students to the list, and check attendance.
3.4
Extend the class Stack to provide a new method called pushdown(i) that duplicates the top element and pushes the copy i elements down. For example, let s be a stack with three elements [a,b,c], where a is the top element. After the operation s.pushdown(2), the stack becomes [a,b,a,c].
3.5Review the following Java concepts and keywords: class, reference, object, method, constructor, call-by-value, signature, overloading, inheritance, overriding, control access, this, and super.