public void AddToFront(Employee e) { EmployeeNode node = new EmployeeNode(e); node.EmployeeNext = head; head = node; Size++; }
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 "); }
public EmployeeNode RemoveFromFront() { if (IsEmpty()) { return(null); } EmployeeNode removeNode = head; head = head.EmployeeNext; Size--; removeNode.EmployeeNext = null; return(removeNode); }