static List<long> buildPermutations()
        {
            char[] chars = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; //
            List<long> perms = new List<long>();

            List<CharNode> tree = new List<CharNode>();
            foreach (char c in chars) {
                CharNode cn = new CharNode(c, chars.ToList<char>());
                tree.Add(cn);
            }
            foreach (CharNode cn in tree) {
                //Console.WriteLine(cn.getTree().Count);
                foreach (string s in cn.getTree()) {
                    //Console.WriteLine(s);
                    perms.Add(long.Parse(s));
                }
            }
                return perms;
        }
Exemple #2
0
        static List <long> buildPermutations()
        {
            char[]      chars = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; //
            List <long> perms = new List <long>();

            List <CharNode> tree = new List <CharNode>();

            foreach (char c in chars)
            {
                CharNode cn = new CharNode(c, chars.ToList <char>());
                tree.Add(cn);
            }
            foreach (CharNode cn in tree)
            {
                //Console.WriteLine(cn.getTree().Count);
                foreach (string s in cn.getTree())
                {
                    //Console.WriteLine(s);
                    perms.Add(long.Parse(s));
                }
            }
            return(perms);
        }