Can someone please tell me why I keep getting a stack overflow when I try to create nodes in a priority queue?
class Node
{
public int frequency; // data item (key)
public char character; // data item
public Node leftChild; // this node's left child
public Node rightChild; // this node's right child
public HuffmanTree leaf;
public HuffmanLeaf leaf1;
//LinkedList<Integer> bob;
//bob = new LinkedList<Integer>();
PriorityQueue<Node> trees;
public Node() //Constructor
{
}
public Node(int passed_frequency, char char_character) //Constructor
{
//super(frequency);
System.out.println("Start of Node(int passed_frequency");
/*for (int i = 0; i < 1; i++)
{
//System.out.println("passed frequency " + passed_frequency +
//" char_character " + char_character);
}*/
int work = passed_frequency;
char grr = char_character;
trees.offer(new Node(work, grr));
System.out.println("--------------------------------------------");
//break;
}
}