void insertStudent(Student *& head);
void deleteStudent(Student *& head);
void displayInReverse(Student *& head);
void displayInOrder(Student *& head);
int main()
{
Student * head = NULL;
char answer = 'Y';
while(toupper(answer) == 'Y')
{
insertStudent(head);
cout << "Enter another student record (y or n)?";
cin >> answer;
}
cout << "Here is the list of students: " << endl;
displayInReverse(head);
deleteStudent(head);
cout << "Here is the list of students after the deletion: " << endl;
displayInReverse(head);
cout << "Here is the list of students in order using recursive function after
the deletion: " << endl;
displayInOrder(head);
}
void insertStudent(Student *& head)
{
Student * temp = new Student;
cout << "Enter Id: ";
cin >> temp->id;
cin.ignore();
cout << "Enter name:";
getline(cin, temp->name);
temp->next = head;
head = temp;
}
void deleteStudent(Student *& head)
{
int id;
Student * lead = head;
Student * follow = head;
cout << "Enter ID you would like to delete: ";
cin >> id;
while (lead->next != NULL && lead->id != id)