Ejemplo n.º 1
0
        /// <summary>
        /// 深度
        /// </summary>
        /// <returns></returns>
        public Int32 Depth()
        {
            if (m_Children == null)
            {
                return(1);
            }
            Int32 nChildSize = m_Children.Count;

            if (nChildSize == 0)
            {
                return(1);
            }
            Int32 nMaxDepth = 1;

            for (Int32 i = 0; i < nChildSize; ++i)
            {
                CTreeNode childNode = m_Children[i];
                if (childNode == null)
                {
                    continue;
                }
                Int32 nDepth = childNode.Depth();
                if (nDepth >= nMaxDepth)
                {
                    nMaxDepth = nDepth + 1;
                }
            }
            return(nMaxDepth);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 深度
 /// </summary>
 /// <returns></returns>
 public Int32 Depth()
 {
     if (m_NodeRoot == null)
     {
         return(0);
     }
     return(m_NodeRoot.Depth());
 }