using System;
using System.Collections;

namespace QCGM.Board
{

	/// <summary>
	/// Summary description for MinPriorityQueue.
	/// </summary>
	public class MinPriorityQueue
	{
		protected Heap H;
		
		public MinPriorityQueue()
		{
			H = new Hashtable();
		}


		/// <summary>
		/// Inserts the object O into the queue, with the priority specified.
		/// </summary>
		/// <param name="O">The object to add to the queue.</param>
		/// <param name="priority">The priority of the object.</param>
		public void Insert(object O, int priority)
		{
			H.Add(O, Int32.MinValue);
			
		}

		
		/// <summary>
		/// Extracts the minimum priority object in the queue.
		/// </summary>
		/// <returns>The object with the lowest priority.</returns>
		public object ExtractMin()
		{
			if(A.Count == 0)
			{
				throw new Exception("Heap underflow");
			}

			object min = A[0];
			A.RemoveAt(0);

			MaxHeapify(1);

			return min;
		}

		/// <summary>
		/// Returns the object with the lowest priority without extracting it.
		/// </summary>
		/// <returns>Returns the object with the lowest priority without extracting it.</returns>
		public object Minimum()
		{
			return A[0];
		}

		/// <summary>
		/// Decreases element's key (priority) to the specified value. Priority is assumed to be at most as big as the current priority.
		/// </summary>
		/// <param name="element">The element to modify.</param>
		/// <param name="priority">The new value for the key.</param>
		protected void DecreaseKey(int index, int priority)
		{
			if(priority > 
		}





	}
}
