Hi, I want to craete a method class method public static <E> boolean eq( Stack<E> s1, Stack<E> s2 ). to compare two stacks (one stack is Array stack, the other is LinkedList stack for example), the method returns true if and only if s1 and s2 contain the same number of elements and the elements in the same positions are “equals”;
public class TwoStack{
public static <E> boolean eq( Stack<E> xs, Stack<E> ys ) {
throw new UnsupportedOperationException( "Error exception" );
}
}
public class TwoStack{
public static <E> boolean eq( Stack<E> xs, Stack<E> ys ) {
throw new UnsupportedOperationException( "Error exception" );
}
}