public PatientList EnQueue(Patient inputdata) { if (head == null) { head = new PatientList(inputdata); tail = head; count++; return(head); } else { //add to head PatientList temphead = new PatientList(inputdata); temphead.Next = head; head = temphead; count++; return(head); } }
public override string ToString() { string output = ""; if (head == null) { output += "There are 0 patients in the queue.\n"; } else { PatientList current = head; while (current != null) { output += current.Data.Name + " " + current.Data.Priority; output += "\n"; current = current.Next; } } return(output); }