private static Node ReadTrie() { if (BinaryStdIn.ReadBoolean()) { return(new Node(BinaryStdIn.ReadChar(), 0, null, null)); } return(new Node('\0', 0, ReadTrie(), ReadTrie())); }
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)); } }
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; } }