write a program on link list to get information about
graduated students?



write a program on link list to get information about graduated students?..

Answer / Gaurav Ankur

Creating a program to store and retrieve information about graduates using linked lists can vary greatly depending on the programming language. Here's an example in C++:n```cppn#include <iostream>nusing namespace std;nnstruct Student {n int id;n string name;n string degree;n string graduationYear;n struct Student* next;n};nnvoid addStudent(struct Student** head, struct Student* newStudent) {n if (*head == NULL) {n *head = newStudent; n return ;n }n struct Student* temp = *head;n while (temp->next != NULL) {n temp = temp->next;n }n temp->next = newStudent;n }nnvoid displayStudents(struct Student* head) {n if (head == NULL) {n cout << "List is empty." << endl; n return ;n }n struct Student* temp = head;n while (temp != NULL) {n cout << "ID: " << temp->id << "n Name: " << temp->name << "n Degree: " << temp->degree << "n Graduation Year: " << temp->graduationYear << endl;n temp = temp->next;n }n }nnint main() {n struct Student* head = NULL; n struct Student newStudent1 = {n 1,n "John Doe",n "Bachelor of Science in Computer Science",n "2020"};n struct Student newStudent2 = {n 2,n "Jane Smith",n "Master of Business Administration",n "2018"};n addStudent(&head, &newStudent1);n addStudent(head->next, &newStudent2);n displayStudents(head);n return 0;n }n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More General Physics Interview Questions

the the domestic consumption of electricity is calculated in

3 Answers   BEd,


In beta minus emission, the number of nucleons in the atom?

1 Answers  


Explain the Rectilinear Propagation of Light ?

34 Answers  


What is Lunar module?

1 Answers  


the resolutions of a michelson interferometer operating with a light source of 640nm wavelenth is A.1280nm B.640nm C.80 nm D.1nm

1 Answers   CSIR,


What is Slaked lime ?

1 Answers  


why sink condition occur in vivo.???

1 Answers   Pharmacist,


assuming g = 9.8 m/sec2, what is the weight on earth, in newtons, of a 60 kilogram person?

1 Answers  


Explain how is nuclear fission different from nuclear fusion?

1 Answers  


What is the velocity of wireless waves ?

1 Answers  


two person are waking same speed.one is walking state and another walking circle. who will go long distance

9 Answers   L&T, SSC,


What is the purpose served by ventilation in building ?

1 Answers  


Categories