public static void printCodes(node rootN, StringBuffer prefix) {
   //Makes the prefix codes for the characters
      node n = (node)rootN;
      
      if(n.l == null && n.r == null){
         System.out.println(n.val + "\t" + n.frequency + "\t" + prefix);
         strNode a = new strNode();
         a.original = n.val;
         a.replace = prefix.toString();
         replaceArr.add(a);
      }
      else{
         prefix.append('0');
         printCodes(n.l, prefix);
         prefix.deleteCharAt(prefix.length()-1);

         prefix.append('1');
         printCodes(n.r, prefix);
         prefix.deleteCharAt(prefix.length()-1);
      }
   }