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