Exemple #1
0
        /// <summary>
        /// Checks if the node exists
        /// </summary>
        /// <param name="node">the node to check</param>
        /// <returns>wether the node exists or not</returns>
        private bool Exists(ISingleLinkNode <T> nodeToCheck)
        {
            if (FirstNode == null)
            {
                return(false);
            }
            var node = FirstNode;

            do
            {
                if (node == nodeToCheck)
                {
                    return(true);
                }
                node = node.Next;
            } while (node != FirstNode);
            return(false);
        }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="node"></param>
 /// <returns></returns>
 private T Remove(ISingleLinkNode <T> node)
 {
     //The list is empty
     if (FirstNode == null)
     {
         return(default);