Class ListAsArray

java.lang.Object
  |
  +--ListAsArray

public class ListAsArray
extends java.lang.Object

Class ListAsArray illustrates the O(N) running time for the putFirst method in an array-based implementation of a list.


Constructor Summary
ListAsArray()
          Allocate a list of the default size of 100000.
 
Method Summary
 void clear()
          Clear out all of the elements of this.
 void putFirst(java.lang.Object element)
          Add the given element to the front of this.
 java.lang.String toString()
          Convert this to a space-delimited string of its elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListAsArray

public ListAsArray()
Allocate a list of the default size of 100000.
Method Detail

putFirst

public void putFirst(java.lang.Object element)
Add the given element to the front of this.

clear

public void clear()
Clear out all of the elements of this.

toString

public java.lang.String toString()
Convert this to a space-delimited string of its elements.
Overrides:
toString in class java.lang.Object