Exemple #1
0
        public override void Add(object obj)
        {
            MyLinkedListNodeSingly newLinkListNode = new MyLinkedListNodeSingly(obj);

            if (insertNode.Next != null)
            {
                newLinkListNode.SetNext(insertNode.Next);
            }
            insertNode.SetNext(newLinkListNode);
            Console.WriteLine($"Added:{obj}");
        }
        public override void Push(object obj)
        {
            MyLinkedListNodeSingly newLinkListNode = new MyLinkedListNodeSingly(obj);

            if (linkListhead.Next != null)
            {
                newLinkListNode.SetNext(linkListhead.Next);
            }
            linkListhead.SetNext(newLinkListNode);
            Console.WriteLine($"Pushed:{obj}");
        }