public PrefixTree(char[] letter, double frequency[])
	{
		pq = new PriorityQueue<PrefixTreeNode>();
		for (int i = 0; i < letter.length; i++)
			pq.add(new PrefixTreeLeaf(letter[i], frequency[i]));

		while (pq.size() > 1)
		{
			PrefixTreeNode left = pq.remove();
			PrefixTreeNode right = pq.remove();
			pq.add(new PrefixTreeNode(left, right));
		}
		root = pq.remove();

		code = new HashMap<Character, String>();
		calculatePrefixCode(root, new String(""));
	}