Exemplo n.º 1
0
        public static T ReverseLookup <T>(this StackingLinkedList <T> sll, Func <T, bool> lookupUntilPredicate) where T : class
        {
            var currentNode = sll.Previous;

            while (currentNode != null && lookupUntilPredicate(currentNode.Value))
            {
                currentNode = currentNode.Previous;
            }

            return(currentNode?.Value);
        }
Exemplo n.º 2
0
 public static IEnumerable <T> GetAncestors <T>(this StackingLinkedList <T> sll) where T : class
 {
     return(sll.ToList().Reverse());
 }