Ejemplo n.º 1
0
        private string displaySibling(int space)
        {
            string result  = "";
            Node   sibling = this.Sibling;

            if (sibling != null)
            {
                string tab = "";
                for (int i = 0; i < space; i++)
                {
                    tab += "---";
                }

                result += string.Format("{0}{1}", tab, sibling);
                result += sibling.displayChild(space + 1);
                result += sibling.displaySibling(space);
            }

            return(result);
        }
Ejemplo n.º 2
0
        private string displayChild(int space)
        {
            string result = "";
            Node   child  = this.Child;

            if (child != null)
            {
                string tab = "";
                for (int i = 0; i < space; i++)
                {
                    tab += "---";
                }

                result += string.Format("{0}{1}", tab, child);
                result += child.displayChild(space + 1);
                result += child.displaySibling(space);
            }

            return(result);
        }