Code example for Vector

Methods: lastElement, setElementAt, setSize, size

0
	public T poll()  
	{ 
        T top = this.peek();
        if (top != null)
        { 
	        T bottom_elt = heap.lastElement();
	        heap.setElementAt(bottom_elt, TOP);
	        object_indices.put(bottom_elt, new Integer(TOP));
	         
	        heap.setSize(heap.size() - 1);  // remove the last element
	        if (heap.size() > 1)
	        	percolateDown(TOP);
	 
	        object_indices.remove(top);
        } 
        return top;
	} 
 
	public T remove()  
	{ 
		T top = this.poll();