public override FTree <T> App2(List <T> ts, FTree <T> rightFT) { FTree <T> resultFT = rightFT; for (int i = ts.Count - 1; i >= 0; i--) { resultFT = resultFT.Push_Front(ts[i]); } return(resultFT.Push_Front(theSingle)); }
public override FTree <T> Push_Front(T t) { if (frontDig.digNodes.Count == 4) { List <T> newFront = new List <T>(frontDig.digNodes); newFront.RemoveAt(0); return(new DeepFTree <T>(new Digit <T>(t, frontDig.digNodes[0]), innerFT.Push_Front(new Node <T>(newFront)), backDig )); } else //less than three digits in front -- will accomodate one more { List <T> newFront = new List <T>(frontDig.digNodes); newFront.Insert(0, t); return(new DeepFTree <T>(new Digit <T>(newFront), innerFT, backDig)); } }
public override FTree <T> Merge(FTree <T> rightFT) { return(rightFT.Push_Front(theSingle)); }