Ejemplo n.º 1
0
        public IEnumerable <T> GetEnumeratorByDelegate(MyDelegate <T> del)
        {
            DoublyNode <T> current = (DoublyNode <T>)Head;

            while (current != null)
            {
                var validate = del?.Invoke(current.Item);

                if (validate == true)
                {
                    yield return(current.Item);
                }
                current = (DoublyNode <T>)current.NextElement;
            }
        }
Ejemplo n.º 2
0
        protected override Node <T> CreateNode(T item)
        {
            DoublyNode <T> node = new DoublyNode <T>(item);

            return(node);
        }