Пример #1
0
        public NodeInt Map(Func <int, int> func)
        {
            NodeInt result = new NodeInt();

            Iterate((v) => result.Add(func(v)));
            return(result);
        }
Пример #2
0
        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);
        }