Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 public SickTree()
 {
     Root           = new SickTreeNode <TItem, TDecision>();
     CurrTraversion = Traversion.PreOrder;
 }
Ejemplo n.º 3
0
 public SickTreeEnumerator(SickTree <TItem, TDecision> tree, Traversion traversion)
 {
     list = tree.Traverse(traversion);
 }