Add element in amortized constant time @param e Element to add at end of list
( E e )
| 37 | * @param e Element to add at end of list |
| 38 | **/ |
| 39 | public E push( E e ) { |
| 40 | if( _len >= _es.length ) _es = Arrays.copyOf(_es,Math.max(1,_es.length<<1)); |
| 41 | return (_es[_len++] = e); |
| 42 | } |
| 43 | /** @return remove and return last element */ |
| 44 | public E pop( ) { |
| 45 | return _len==0 ? null : _es[--_len]; |
no outgoing calls