Example #1
0
        /// <summary>
        /// Adds a patient to the data structure.
        /// </summary>
        /// <param name="patient">The patient to be added.</param>
        public void AddPatient(Patient patient)
        {
            int index = Patient.genPatientId(patient.FirstName, patient.LastName) % this.size;
            SimpleLinkedList <Patient> pList = list[index];

            if (pList == null)
            {
                pList = new SimpleLinkedList <Patient>();
                pList.AddAtHead(patient);
                list[index] = pList;
            }
            else
            {
                pList.AddAtHead(patient);
            }
        }