title: Algorithm for Huffman Tree not working
body: <p>I'm trying to create a Huffman Tree zipper. I started to create the List with the class Node as type, and the characters in the input string should be added to the list? But how come I cannot print the list (the char and frequency of the char in the string)? </p>
  
  <pre><code>private void btnKomprimer_Click(object sender, System.Windows.RoutedEventArgs e)
  {
      int k = 0;
      string input;
      char karakter;
      input = txtInput.Text;
      input = input.ToLower();
      txtOutput.Text = "";
  
      List&lt;Node&gt; noder = new List&lt;Node&gt;();
      for (int i = 0; i &lt; input.Length; i++)
      {   
          karakter = input[i];
  
          for (int j = 0; j &lt; noder.Count; j++)
          {
              if (noder[j].ErTegn(karakter) == true)
              {
                  noder.Add(new Node(karakter));
              }
              else
              {
                  noder[j].ØkMed1();
              }
          }
      }
      while (noder[k] != null)
      {
          txtOutput.Text += noder[k].Resultat();
          k++;
      }
  }
  
  public class Node
  {
      public int frekvens;
      public char tegn;
  
      public Node (char c)
      {
          frekvens = 1;
          tegn = c;
      }
  
      public void ØkMed1()
      {
          frekvens = frekvens + 1;
      }
  
      public bool ErTegn(char c)
      {
          if ( c == tegn)
          {
              return false;
          }
          else
          {
              return true;
          }
      }
  
      public string Resultat()
      {
          string resultat;
          resultat = Convert.ToString(tegn) + Convert.ToString(frekvens) + "\n";
          return resultat;
      }
  }
  </code></pre>