Example #1
0
        public List <TItem> Traverse(Traversion traversion)
        {
            List <TItem> result = new List <TItem>();

            switch (traversion)
            {
            case Traversion.PreOrder:
                PreOrder(Root, ref result);
                break;

            case Traversion.PostOrder:
                PostOrder(Root, ref result);
                break;

            default:
                throw new ArgumentException("Traversion not supported (did the enum change?)");
            }

            return(result);
        }
Example #2
0
 public SickTree()
 {
     Root           = new SickTreeNode <TItem, TDecision>();
     CurrTraversion = Traversion.PreOrder;
 }
Example #3
0
 public SickTreeEnumerator(SickTree <TItem, TDecision> tree, Traversion traversion)
 {
     list = tree.Traverse(traversion);
 }