Declare a struct of your choice (Employee, Student etc). Delcare a node for singly link list. Declare an ADT of this linklist. Then Write a function which takes two ADTs of sorted Link Lists and Merges them into third in such a way third link list remains sorted on each insertion of new element. Repeat the part 1 with STL linklist.

Respuesta :

Answer:

Part 2 is remaining I m working on it

Explanation:

#include <iostream>

using namespace std;

struct student {

int Rollno;

char Studentname[50];

int marks;

char semester[50];

};

int main() {

struct student stud[2] = { { 1 , "nasir" , 300 , "4th" } , { 2 , "abid" , 400 , "4th" } };

cout<<"Students Result is given as follows:"<<endl;

cout<<endl;

for(int i=0; i<2;i++) {

cout<<"Roll no: "<<stud[i].Rollno<<endl;

cout<<"Name: "<<stud[i].Studentname<<endl;

cout<<"Marks: "<<stud[i].marks<<endl;

cout<<"Semester : "<<stud[i].semester<<endl;

cout<<endl;

}

return 0;

}

ACCESS MORE
ACCESS MORE
ACCESS MORE
ACCESS MORE