Esempio n. 1
0
        /// <summary>
        /// Print the circular linked list .
        /// </summary>
        /// <param name="circularLinkedList"></param>
        public static void DisplayCircularLinkedList(CircularLinkedList <T> circularLinkedList)
        {
            //if last is null.
            if (circularLinkedList.Last == null)
            {
                return;
            }
            //start point.
            var startPoint = circularLinkedList.Last.Link;

            do
            {
                Console.WriteLine(startPoint.Info);
                startPoint = startPoint.Link;
            } while (!startPoint.Equals(circularLinkedList.Last.Link));
        }
Esempio n. 2
0
 //Constructor.
 public CircularLinkedListUserInterface()
 {
     _list = new CircularLinkedList <T>();
 }