コード例 #1
0
 private static Node ReadTrie()
 {
     if (BinaryStdIn.ReadBoolean())
     {
         return(new Node(BinaryStdIn.ReadChar(), 0, null, null));
     }
     return(new Node('\0', 0, ReadTrie(), ReadTrie()));
 }
コード例 #2
0
        public void Expand()
        {
            Alphabet DNA = new Alphabet("ACTG");
            int      w   = DNA.LgR();
            int      n   = BinaryStdIn.ReadInt();

            for (int i = 0; i < n; i++)
            {
                var c = BinaryStdIn.ReadChar(w);
                BinaryStdOut.Write(DNA.ToChar(c));
            }
        }
コード例 #3
0
        public void Expand()
        {
            bool b = false;

            while (!BinaryStdIn.IsEmpty())
            {
                char cnt = BinaryStdIn.ReadChar();
                for (int i = 0; i < cnt; i++)
                {
                    BinaryStdOut.Write(b);
                }
                b = !b;
            }
        }