public NodeInt Map(Func <int, int> func) { NodeInt result = new NodeInt(); Iterate((v) => result.Add(func(v))); return(result); }
public ListInt Filter(Func <int, bool> func) { NodeInt result = new NodeInt(); Iterate((v) => { if (func(v)) { result.Add(v); } }); return(result.IsEmpty ? (ListInt) new EmptyInt() : result); }