public T pop(){
        if(size == 0)
            throw new NoSuchElementException();
        T value = arr[--size];
        arr[size] = null;
        if(size > 0 && size == arr.length / 4)
            resize(arr.length / 2);
        return value;
    }