Example #1
0
        private IEnumerable <BinaryTree <T> > OutOrderTraverse()
        {
            if (RightNode != null)
            {
                foreach (var item in RightNode.OutOrderTraverse())
                {
                    yield return(item);
                }
            }
            yield return(this);

            if (LeftNode != null)
            {
                foreach (var item in LeftNode.OutOrderTraverse())
                {
                    yield return(item);
                }
            }
        }