Exemple #1
0
        public void AddToFront(Employee e)
        {
            EmployeeNode node = new EmployeeNode(e);

            node.EmployeeNext = head;
            head = node;
            Size++;
        }
Exemple #2
0
        public void PrintLinkedList()
        {
            EmployeeNode current = head;

            Console.Write("head - > ");
            while (current != null)
            {
                Console.Write(current.To_String());
                Console.Write("   ->   ");
                current = current.EmployeeNext;
            }
            Console.WriteLine(" null ");
        }
Exemple #3
0
        public EmployeeNode RemoveFromFront()
        {
            if (IsEmpty())
            {
                return(null);
            }
            EmployeeNode removeNode = head;

            head = head.EmployeeNext;
            Size--;
            removeNode.EmployeeNext = null;
            return(removeNode);
        }