text: public virtual Trie Optimize(Trie orig){IList<string> cmds = orig.cmds;IList<Row> rows = new List<Row>();IList<Row> orows = orig.rows;int[] remap = new int[orows.Count];Arrays.Fill(remap, -1);rows = RemoveGaps(orig.root, rows, new List<Row>(), remap);return new Trie(orig.forward, remap[orig.root], cmds, rows);}