Why am I getting an error for this code? (Priority Queue)

  • Thread starter Thread starter blackbearox
  • Start date Start date
B

blackbearox

Guest
So, this is probably a dumb question but basically, I have an assignment in C# dealing with Huffman codes and my prof gave us all the following code "skeleton" that we HAVE to use and we just have to fill it all in. Some are underlined due to the fact that the method isn't returning a value, but the line "PriorityQueue<Node> PQ;" is underlined saying "The type or namespace name 'PriorityQueue<>' could not be found." How do I fix this error? Will it be resolved when I am doing the coding within the classes and methods, or is it something else?
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections;

namespace Huffman_Codes
{
class Node : IComparable
{
public char Character { get; set; }
public int Frequency { get; set; }
public Node Left { get; set; }
public Node Right { get; set; }

public Node (char character, int frequency, Node left, Node right)
{

}

public int CompareTo (Object obj)
{

}
}

class Huffman
{
private Node HT; // Huffman tree to create codes and decode text
private Dictionary<char, string> D; // Dictionary to encode text

// Constructor
public Huffman (string S)
{

}

// Return the frequency of each character in the given text (invoked by Huffman)
private int[] AnalyzeText (string S)
{

}

// Build a Huffman tree based on the character frequencies greater than 0 (invoked by Huffman)
private void Build ( int[] F)
{
PriorityQueue<Node> PQ;
}

// Create the code of 0s and 1s for each character by traversing the Huffman tree (invoked by Huffman)
private void CreateCodes ()
{

}

// Encode the given text and return a string of 0s and 1s
public string Encode (string S)
{

}

// Decode the given string of 0s and 1s and return the original text
public string Decode (string S)
{

}
}
}

Continue reading...
 
Back
Top