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