public interface SimpleList<AnyType>
extends java.lang.Iterable<AnyType>
remove
should run in O(1) time.
Make *NO*! changes to this file!Modifier and Type | Method and Description |
---|---|
boolean |
add(AnyType value)
Inserts an element at the end of the list.
|
boolean |
isEmpty()
Determines whether the list is empty.
|
boolean |
remove(AnyType value)
Removes the first element of the list that equals value.
|
boolean isEmpty()
true
if the list is empty; false
otherwiseboolean add(AnyType value)
value
- the element to be inserted into the listtrue
if the element was added; false
otherwiseboolean remove(AnyType value)
value
- the element to removetrue
if the element was removed; false
otherwise