Code example for PriorityQueue

Methods: add

0
	/** 
	 * Adds a new task to the heap 
	 * @param t task to be added 
	 */ 
	public void enqueue(Task t) { 
		queue.add(t); 
	} 
	 
	public void enqueueAll(List<Task> list) { 
		queue.addAll(list); 
	} 
	 
	public int size() { 
		return queue.size(); 
	} 
	 
	/** 
	 * Retrieves the task with the maximum priority from  the heap 
	 * @return Task with the maximum priority 
	 */ 
	public Task dequeue() {