Example #1
0
        //遍历
        public datanode <Assort> Ergodic(datanode <Assort> j)
        {
            if (j.getdatakuobject() == null)
            {
                return(j);
            }
            else
            {
                List <datanode <Assort> > mlist = j.getdatakuobject();
                for (int i = 0; i < mlist.Count; i++)
                {
                }


                return(j);
            }
        }
Example #2
0
        //搜索数据专用
        private datanode <Assort> serchnode_(string usename, datanode <Assort> mm)
        {
            // Console.Write("循环第{0}次",i1++);

            Char[] ma = usename.ToCharArray();
            if (ma.Length == 0)
            {
                return(mm);
            }
            string                    nameflag = ma[0].ToString();
            datanode <Assort>         ff1      = mm;
            datanode <Assort>         ss       = null;
            List <datanode <Assort> > m1       = mm.getdatakuobject();
            Boolean                   fm       = false;

            if (nameflag.Length != 0)
            {
                for (int i = 0; i < mm.getdataku(); i++)
                {
                    datanode <Assort> m2 = m1.ElementAt(i);

                    if (m2.getname() == nameflag)
                    {
                        fm = true;
                        ss = m2;
                        break;
                    }
                }

                if (fm)
                {
                    nameflag = usename.Substring(1);
                    Console.Write("\ndigui第{0}次", ffff++);
                    return(serchnode_(nameflag, ss));
                }
                else
                {
                    //Console.Write("\n循环第{0}次", i1++);
                    //ss = mm;
                    //  ss.createnode(nameflag, null, null);
                    // mm.addnode();
                    // nameflag = usename.Substring(1);
                    // serchnode_(nameflag, ss.getnextnode());
                    return(mm = null);
                }
                //return ff1;
            }
            else
            {
                return(mm);
            }
        }