Example #1
0
        private static void DemonstrateRemoveHeadWithStringList()
        {
            var miniList = new RecursiveLinkedList <string>();

            miniList.AddHead("three");
            miniList.AddHead("two");
            miniList.AddHead("one");
            miniList.AddHead("head");

            ShowList(miniList, "string list members");

            miniList.RemoveHead();
            ShowList(miniList, "headless string list");
        }
Example #2
0
        private static void DemonstrateIntList()
        {
            var list = new RecursiveLinkedList <int>();

            ShowList(list, "the list is empty");

            foreach (var newElement in Enumerable.Range(0, 5))
            {
                list.AddHead(newElement);
            }

            ShowList(list, "int list members");
        }