SlideShare a Scribd company logo
1 of 8
Download to read offline
Using following main file and solve the task
Instead of ID and GPA, now consider following fields: Name, ID and Contact numberInsert last
(already done)Display All (already done)Insert at the beginningDelete the first elementDelete the
last elementSearch an element (by ID)Insert after an elementDisplay how many elements are
there in the listFind the element with highest (biggest) IDFind the element with lowest (smallest)
ID
// main file
please solve all it ... Thank You :)
Using following main file and solve the task
Instead of ID and GPA, now consider following fields: Name, ID and Contact numberInsert last
(already done)Display All (already done)Insert at the beginningDelete the first elementDelete the
last elementSearch an element (by ID)Insert after an elementDisplay how many elements are
there in the listFind the element with highest (biggest) IDFind the element with lowest (smallest)
ID
// main file
please solve all it ... Thank You :)
Instead of ID and GPA, now consider following fields: Name, ID and Contact numberInsert last
(already done)Display All (already done)Insert at the beginningDelete the first elementDelete the
last elementSearch an element (by ID)Insert after an elementDisplay how many elements are
there in the listFind the element with highest (biggest) IDFind the element with lowest (smallest)
ID
// main file
please solve all it ... Thank You :)
// main file
please solve all it ... Thank You :)
Solution
// main file
#include
#include
using namespace std;
struct node{
//change to name , ID and contact number
string name;
int ID; ;
string phone;
//double GPA;
node *link;
};
node *head=NULL, *t;
void insertNode()
{
node *temp=new node;
cout<<"Enter name..";
cin>>temp->name;
cout<<"Enter the ID..";
cin>>temp->ID;
cout<<"Enter Phone..";
cin>>temp->phone;
temp->link=NULL;
if(head==NULL)//list is empty
{
head=temp;
}
else
{
t=head;
while(t->link!=NULL)
t=t->link;
t->link=temp;
}
}
void displayAll()
{
node *t=head;
while(t!=NULL)
{
cout<<"Name="<name<ID<phone<link;
}
}
void isertAtbegin()
{
node *cur = head;
node *temp=new node;
cout<<"Enter name..";
cin>>temp->name;
cout<<"Enter the ID..";
cin>>temp->ID;
cout<<"Enter Phone..";
cin>>temp->phone;
head = temp;
temp->link = cur;
}
void deleteFirstElement()
{
node *cur = head,*prev=head;
head = head->link;
free(cur);
}
void searchElement(int ID)
{
node *cur = head;
int found = 0,pos=0;
while( cur!=NULL)
{
if( ID == cur->ID )
{
found = 1;
break;
}
cur = cur->link;
++pos;
}
if( found )
cout<<"Element with Id= "<link;
node *temp=new node;
cout<<"Enter name..";
cin>>temp->name;
cout<<"Enter the ID..";
cin>>temp->ID;
cout<<"Enter Phone..";
cin>>temp->phone;
temp->link=next;
cur->link = temp;
break;
}
cur = cur->link;
++pos;
}
}
void displayNumberOfelements()
{
node *cur = head;
int count = 0;
while( cur!=NULL)
{
++count;
cur = cur->link;
}
cout<<"Number of elements in list = "<ID;
while( cur!=NULL)
{
if(max < cur ->ID)
{
max = cur ->ID;
}
cur = cur->link;
}
cout<<"The element with highest (biggest) ID = "<ID;
while( cur!=NULL)
{
if(min > cur ->ID)
{
min = cur ->ID;
}
cur = cur->link;
}
cout<<"the element with lowest (smallest) ID = "<>choice;
if(choice==1)
insertNode();
if(choice==2)
displayAll();
if(choice==3)
isertAtbegin();
if(choice==4)
deleteFirstElement();
if(choice==5)
searchElement(12);
if(choice==6)
insertAfterElement(2);
if(choice==7)
displayNumberOfelements();
if(choice==8)
highestId();
if(choice==9)
LowestId();
}//while loop
return 0 ;
}

More Related Content

Similar to Using following main file and solve the taskInst.pdf

In C pls -- Write your name here -- Write the compiler used- Visual st.docx
In C pls -- Write your name here -- Write the compiler used- Visual st.docxIn C pls -- Write your name here -- Write the compiler used- Visual st.docx
In C pls -- Write your name here -- Write the compiler used- Visual st.docxBlake0FxCampbelld
 
1. Add a breadth-first (level-order) traversal function to the binar.pdf
1. Add a breadth-first (level-order) traversal function to the binar.pdf1. Add a breadth-first (level-order) traversal function to the binar.pdf
1. Add a breadth-first (level-order) traversal function to the binar.pdfarjuncp10
 
-- Reminder that your file name is incredibly important- Please do not.docx
-- Reminder that your file name is incredibly important- Please do not.docx-- Reminder that your file name is incredibly important- Please do not.docx
-- Reminder that your file name is incredibly important- Please do not.docxAdamq0DJonese
 
Please answer the 4 questions using C- The expected output is shown be.docx
Please answer the 4 questions using C- The expected output is shown be.docxPlease answer the 4 questions using C- The expected output is shown be.docx
Please answer the 4 questions using C- The expected output is shown be.docxcgraciela1
 
Write a program that accepts an arithmetic expression of unsigned in.pdf
Write a program that accepts an arithmetic expression of unsigned in.pdfWrite a program that accepts an arithmetic expression of unsigned in.pdf
Write a program that accepts an arithmetic expression of unsigned in.pdfJUSTSTYLISH3B2MOHALI
 
written in c- please answer the 4 questions and write the functions ba.pdf
written in c- please answer the 4 questions and write the functions ba.pdfwritten in c- please answer the 4 questions and write the functions ba.pdf
written in c- please answer the 4 questions and write the functions ba.pdfsravi07
 
Sorting & Linked Lists
Sorting & Linked ListsSorting & Linked Lists
Sorting & Linked ListsJ.T.A.JONES
 
C programming. Answer question only in C code In the eighth part, yo.pdf
C programming. Answer question only in C code In the eighth part, yo.pdfC programming. Answer question only in C code In the eighth part, yo.pdf
C programming. Answer question only in C code In the eighth part, yo.pdfmohammedfootwear
 
Doublylinklist
DoublylinklistDoublylinklist
Doublylinklistritu1806
 
please follow all instructions and answer the inbedded questions- and.pdf
please follow all instructions and answer the inbedded questions- and.pdfplease follow all instructions and answer the inbedded questions- and.pdf
please follow all instructions and answer the inbedded questions- and.pdfIan5L3Allanm
 
You are required to implement the following functions for doubly linke.docx
You are required to implement the following functions for doubly linke.docxYou are required to implement the following functions for doubly linke.docx
You are required to implement the following functions for doubly linke.docxJonathan5GxRossk
 
Written in C- requires linked lists- Please answer the 4 questions and.pdf
Written in C- requires linked lists- Please answer the 4 questions and.pdfWritten in C- requires linked lists- Please answer the 4 questions and.pdf
Written in C- requires linked lists- Please answer the 4 questions and.pdfsravi07
 
Written in C- requires linked lists- Please answer the 4 questions and (1).pdf
Written in C- requires linked lists- Please answer the 4 questions and (1).pdfWritten in C- requires linked lists- Please answer the 4 questions and (1).pdf
Written in C- requires linked lists- Please answer the 4 questions and (1).pdfsravi07
 
Use the singly linked list class introduced in the lab to implement .pdf
Use the singly linked list class introduced in the lab to implement .pdfUse the singly linked list class introduced in the lab to implement .pdf
Use the singly linked list class introduced in the lab to implement .pdfsales87
 
Solve using Java programming language- ----------------------------.pdf
Solve using Java programming language-   ----------------------------.pdfSolve using Java programming language-   ----------------------------.pdf
Solve using Java programming language- ----------------------------.pdfaksahnan
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxDIPESH30
 
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdfganisyedtrd
 
C++ Please write the whole code that is needed for this assignment- wr.docx
C++ Please write the whole code that is needed for this assignment- wr.docxC++ Please write the whole code that is needed for this assignment- wr.docx
C++ Please write the whole code that is needed for this assignment- wr.docxBrianGHiNewmanv
 

Similar to Using following main file and solve the taskInst.pdf (20)

In C pls -- Write your name here -- Write the compiler used- Visual st.docx
In C pls -- Write your name here -- Write the compiler used- Visual st.docxIn C pls -- Write your name here -- Write the compiler used- Visual st.docx
In C pls -- Write your name here -- Write the compiler used- Visual st.docx
 
1. Add a breadth-first (level-order) traversal function to the binar.pdf
1. Add a breadth-first (level-order) traversal function to the binar.pdf1. Add a breadth-first (level-order) traversal function to the binar.pdf
1. Add a breadth-first (level-order) traversal function to the binar.pdf
 
-- Reminder that your file name is incredibly important- Please do not.docx
-- Reminder that your file name is incredibly important- Please do not.docx-- Reminder that your file name is incredibly important- Please do not.docx
-- Reminder that your file name is incredibly important- Please do not.docx
 
DSA(1).pptx
DSA(1).pptxDSA(1).pptx
DSA(1).pptx
 
Please answer the 4 questions using C- The expected output is shown be.docx
Please answer the 4 questions using C- The expected output is shown be.docxPlease answer the 4 questions using C- The expected output is shown be.docx
Please answer the 4 questions using C- The expected output is shown be.docx
 
Write a program that accepts an arithmetic expression of unsigned in.pdf
Write a program that accepts an arithmetic expression of unsigned in.pdfWrite a program that accepts an arithmetic expression of unsigned in.pdf
Write a program that accepts an arithmetic expression of unsigned in.pdf
 
written in c- please answer the 4 questions and write the functions ba.pdf
written in c- please answer the 4 questions and write the functions ba.pdfwritten in c- please answer the 4 questions and write the functions ba.pdf
written in c- please answer the 4 questions and write the functions ba.pdf
 
Sorting & Linked Lists
Sorting & Linked ListsSorting & Linked Lists
Sorting & Linked Lists
 
C programming. Answer question only in C code In the eighth part, yo.pdf
C programming. Answer question only in C code In the eighth part, yo.pdfC programming. Answer question only in C code In the eighth part, yo.pdf
C programming. Answer question only in C code In the eighth part, yo.pdf
 
Doublylinklist
DoublylinklistDoublylinklist
Doublylinklist
 
please follow all instructions and answer the inbedded questions- and.pdf
please follow all instructions and answer the inbedded questions- and.pdfplease follow all instructions and answer the inbedded questions- and.pdf
please follow all instructions and answer the inbedded questions- and.pdf
 
You are required to implement the following functions for doubly linke.docx
You are required to implement the following functions for doubly linke.docxYou are required to implement the following functions for doubly linke.docx
You are required to implement the following functions for doubly linke.docx
 
Written in C- requires linked lists- Please answer the 4 questions and.pdf
Written in C- requires linked lists- Please answer the 4 questions and.pdfWritten in C- requires linked lists- Please answer the 4 questions and.pdf
Written in C- requires linked lists- Please answer the 4 questions and.pdf
 
Written in C- requires linked lists- Please answer the 4 questions and (1).pdf
Written in C- requires linked lists- Please answer the 4 questions and (1).pdfWritten in C- requires linked lists- Please answer the 4 questions and (1).pdf
Written in C- requires linked lists- Please answer the 4 questions and (1).pdf
 
Use the singly linked list class introduced in the lab to implement .pdf
Use the singly linked list class introduced in the lab to implement .pdfUse the singly linked list class introduced in the lab to implement .pdf
Use the singly linked list class introduced in the lab to implement .pdf
 
Dtd
DtdDtd
Dtd
 
Solve using Java programming language- ----------------------------.pdf
Solve using Java programming language-   ----------------------------.pdfSolve using Java programming language-   ----------------------------.pdf
Solve using Java programming language- ----------------------------.pdf
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
 
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
 
C++ Please write the whole code that is needed for this assignment- wr.docx
C++ Please write the whole code that is needed for this assignment- wr.docxC++ Please write the whole code that is needed for this assignment- wr.docx
C++ Please write the whole code that is needed for this assignment- wr.docx
 

More from feetshoemart

Convert the following expressions from infix to Reverse Polish Notati.pdf
Convert the following expressions from infix to Reverse Polish Notati.pdfConvert the following expressions from infix to Reverse Polish Notati.pdf
Convert the following expressions from infix to Reverse Polish Notati.pdffeetshoemart
 
Andy and Joan are married and under 65 years of age. They have two c.pdf
Andy and Joan are married and under 65 years of age. They have two c.pdfAndy and Joan are married and under 65 years of age. They have two c.pdf
Andy and Joan are married and under 65 years of age. They have two c.pdffeetshoemart
 
Compare the methods by which the Parsees of India benefitted from th.pdf
Compare the methods by which the Parsees of India benefitted from th.pdfCompare the methods by which the Parsees of India benefitted from th.pdf
Compare the methods by which the Parsees of India benefitted from th.pdffeetshoemart
 
Computer Forensics MethodologiesList them and explain each one.P.pdf
Computer Forensics MethodologiesList them and explain each one.P.pdfComputer Forensics MethodologiesList them and explain each one.P.pdf
Computer Forensics MethodologiesList them and explain each one.P.pdffeetshoemart
 
Document2- Word (Product Activation Failed) Mailings Review View Tell.pdf
Document2- Word (Product Activation Failed) Mailings Review View Tell.pdfDocument2- Word (Product Activation Failed) Mailings Review View Tell.pdf
Document2- Word (Product Activation Failed) Mailings Review View Tell.pdffeetshoemart
 
Discussion 1 Choose one of the Opinion Poll questions (click here f.pdf
Discussion 1 Choose one of the Opinion Poll questions (click here f.pdfDiscussion 1 Choose one of the Opinion Poll questions (click here f.pdf
Discussion 1 Choose one of the Opinion Poll questions (click here f.pdffeetshoemart
 
calculate the hydrogen ion concentration in mol for the following s.pdf
calculate the hydrogen ion concentration in mol for the following s.pdfcalculate the hydrogen ion concentration in mol for the following s.pdf
calculate the hydrogen ion concentration in mol for the following s.pdffeetshoemart
 
At a certain temperature, 0.5011 mol of N2 and 1.781 mol of H2 are pl.pdf
At a certain temperature, 0.5011 mol of N2 and 1.781 mol of H2 are pl.pdfAt a certain temperature, 0.5011 mol of N2 and 1.781 mol of H2 are pl.pdf
At a certain temperature, 0.5011 mol of N2 and 1.781 mol of H2 are pl.pdffeetshoemart
 
Consider mappinp, phi Z rightarrow R, defined as phi(x) = 2x, where .pdf
Consider mappinp, phi Z rightarrow R, defined as phi(x) = 2x, where .pdfConsider mappinp, phi Z rightarrow R, defined as phi(x) = 2x, where .pdf
Consider mappinp, phi Z rightarrow R, defined as phi(x) = 2x, where .pdffeetshoemart
 
wk3 reply to prof.I need help with this question below a 200 words.pdf
wk3 reply to prof.I need help with this question below a 200 words.pdfwk3 reply to prof.I need help with this question below a 200 words.pdf
wk3 reply to prof.I need help with this question below a 200 words.pdffeetshoemart
 
Write a program that prompts the user to enter a positive integer and.pdf
Write a program that prompts the user to enter a positive integer and.pdfWrite a program that prompts the user to enter a positive integer and.pdf
Write a program that prompts the user to enter a positive integer and.pdffeetshoemart
 
Write a function called countElements that counts the number of times.pdf
Write a function called countElements that counts the number of times.pdfWrite a function called countElements that counts the number of times.pdf
Write a function called countElements that counts the number of times.pdffeetshoemart
 
This is a java lab assignment. I have added the first part java re.pdf
This is a java lab assignment. I have added the first part java re.pdfThis is a java lab assignment. I have added the first part java re.pdf
This is a java lab assignment. I have added the first part java re.pdffeetshoemart
 
There is no video, All you have to do is show how you reference the .pdf
There is no video, All you have to do is show how you reference the .pdfThere is no video, All you have to do is show how you reference the .pdf
There is no video, All you have to do is show how you reference the .pdffeetshoemart
 
The process of Imperialism and Colonialism played a role in the esta.pdf
The process of Imperialism and Colonialism played a role in the esta.pdfThe process of Imperialism and Colonialism played a role in the esta.pdf
The process of Imperialism and Colonialism played a role in the esta.pdffeetshoemart
 
Terrain AnalysisBackgroundAircraft frequently rely on terrain el.pdf
Terrain AnalysisBackgroundAircraft frequently rely on terrain el.pdfTerrain AnalysisBackgroundAircraft frequently rely on terrain el.pdf
Terrain AnalysisBackgroundAircraft frequently rely on terrain el.pdffeetshoemart
 
What do viral genomes look like compared to those of living organism.pdf
What do viral genomes look like compared to those of living organism.pdfWhat do viral genomes look like compared to those of living organism.pdf
What do viral genomes look like compared to those of living organism.pdffeetshoemart
 
Verify the identity Verify the identity by transforming the left-han.pdf
Verify the identity Verify the identity by transforming the left-han.pdfVerify the identity Verify the identity by transforming the left-han.pdf
Verify the identity Verify the identity by transforming the left-han.pdffeetshoemart
 
Suppose there are 14 children trying to form two teams with seven ch.pdf
Suppose there are 14 children trying to form two teams with seven ch.pdfSuppose there are 14 children trying to form two teams with seven ch.pdf
Suppose there are 14 children trying to form two teams with seven ch.pdffeetshoemart
 
11. Define a simple deformable model to detect a half-circular shape.pdf
11. Define a simple deformable model to detect a half-circular shape.pdf11. Define a simple deformable model to detect a half-circular shape.pdf
11. Define a simple deformable model to detect a half-circular shape.pdffeetshoemart
 

More from feetshoemart (20)

Convert the following expressions from infix to Reverse Polish Notati.pdf
Convert the following expressions from infix to Reverse Polish Notati.pdfConvert the following expressions from infix to Reverse Polish Notati.pdf
Convert the following expressions from infix to Reverse Polish Notati.pdf
 
Andy and Joan are married and under 65 years of age. They have two c.pdf
Andy and Joan are married and under 65 years of age. They have two c.pdfAndy and Joan are married and under 65 years of age. They have two c.pdf
Andy and Joan are married and under 65 years of age. They have two c.pdf
 
Compare the methods by which the Parsees of India benefitted from th.pdf
Compare the methods by which the Parsees of India benefitted from th.pdfCompare the methods by which the Parsees of India benefitted from th.pdf
Compare the methods by which the Parsees of India benefitted from th.pdf
 
Computer Forensics MethodologiesList them and explain each one.P.pdf
Computer Forensics MethodologiesList them and explain each one.P.pdfComputer Forensics MethodologiesList them and explain each one.P.pdf
Computer Forensics MethodologiesList them and explain each one.P.pdf
 
Document2- Word (Product Activation Failed) Mailings Review View Tell.pdf
Document2- Word (Product Activation Failed) Mailings Review View Tell.pdfDocument2- Word (Product Activation Failed) Mailings Review View Tell.pdf
Document2- Word (Product Activation Failed) Mailings Review View Tell.pdf
 
Discussion 1 Choose one of the Opinion Poll questions (click here f.pdf
Discussion 1 Choose one of the Opinion Poll questions (click here f.pdfDiscussion 1 Choose one of the Opinion Poll questions (click here f.pdf
Discussion 1 Choose one of the Opinion Poll questions (click here f.pdf
 
calculate the hydrogen ion concentration in mol for the following s.pdf
calculate the hydrogen ion concentration in mol for the following s.pdfcalculate the hydrogen ion concentration in mol for the following s.pdf
calculate the hydrogen ion concentration in mol for the following s.pdf
 
At a certain temperature, 0.5011 mol of N2 and 1.781 mol of H2 are pl.pdf
At a certain temperature, 0.5011 mol of N2 and 1.781 mol of H2 are pl.pdfAt a certain temperature, 0.5011 mol of N2 and 1.781 mol of H2 are pl.pdf
At a certain temperature, 0.5011 mol of N2 and 1.781 mol of H2 are pl.pdf
 
Consider mappinp, phi Z rightarrow R, defined as phi(x) = 2x, where .pdf
Consider mappinp, phi Z rightarrow R, defined as phi(x) = 2x, where .pdfConsider mappinp, phi Z rightarrow R, defined as phi(x) = 2x, where .pdf
Consider mappinp, phi Z rightarrow R, defined as phi(x) = 2x, where .pdf
 
wk3 reply to prof.I need help with this question below a 200 words.pdf
wk3 reply to prof.I need help with this question below a 200 words.pdfwk3 reply to prof.I need help with this question below a 200 words.pdf
wk3 reply to prof.I need help with this question below a 200 words.pdf
 
Write a program that prompts the user to enter a positive integer and.pdf
Write a program that prompts the user to enter a positive integer and.pdfWrite a program that prompts the user to enter a positive integer and.pdf
Write a program that prompts the user to enter a positive integer and.pdf
 
Write a function called countElements that counts the number of times.pdf
Write a function called countElements that counts the number of times.pdfWrite a function called countElements that counts the number of times.pdf
Write a function called countElements that counts the number of times.pdf
 
This is a java lab assignment. I have added the first part java re.pdf
This is a java lab assignment. I have added the first part java re.pdfThis is a java lab assignment. I have added the first part java re.pdf
This is a java lab assignment. I have added the first part java re.pdf
 
There is no video, All you have to do is show how you reference the .pdf
There is no video, All you have to do is show how you reference the .pdfThere is no video, All you have to do is show how you reference the .pdf
There is no video, All you have to do is show how you reference the .pdf
 
The process of Imperialism and Colonialism played a role in the esta.pdf
The process of Imperialism and Colonialism played a role in the esta.pdfThe process of Imperialism and Colonialism played a role in the esta.pdf
The process of Imperialism and Colonialism played a role in the esta.pdf
 
Terrain AnalysisBackgroundAircraft frequently rely on terrain el.pdf
Terrain AnalysisBackgroundAircraft frequently rely on terrain el.pdfTerrain AnalysisBackgroundAircraft frequently rely on terrain el.pdf
Terrain AnalysisBackgroundAircraft frequently rely on terrain el.pdf
 
What do viral genomes look like compared to those of living organism.pdf
What do viral genomes look like compared to those of living organism.pdfWhat do viral genomes look like compared to those of living organism.pdf
What do viral genomes look like compared to those of living organism.pdf
 
Verify the identity Verify the identity by transforming the left-han.pdf
Verify the identity Verify the identity by transforming the left-han.pdfVerify the identity Verify the identity by transforming the left-han.pdf
Verify the identity Verify the identity by transforming the left-han.pdf
 
Suppose there are 14 children trying to form two teams with seven ch.pdf
Suppose there are 14 children trying to form two teams with seven ch.pdfSuppose there are 14 children trying to form two teams with seven ch.pdf
Suppose there are 14 children trying to form two teams with seven ch.pdf
 
11. Define a simple deformable model to detect a half-circular shape.pdf
11. Define a simple deformable model to detect a half-circular shape.pdf11. Define a simple deformable model to detect a half-circular shape.pdf
11. Define a simple deformable model to detect a half-circular shape.pdf
 

Recently uploaded

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 

Recently uploaded (20)

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 

Using following main file and solve the taskInst.pdf

  • 1. Using following main file and solve the task Instead of ID and GPA, now consider following fields: Name, ID and Contact numberInsert last (already done)Display All (already done)Insert at the beginningDelete the first elementDelete the last elementSearch an element (by ID)Insert after an elementDisplay how many elements are there in the listFind the element with highest (biggest) IDFind the element with lowest (smallest) ID // main file
  • 2. please solve all it ... Thank You :) Using following main file and solve the task Instead of ID and GPA, now consider following fields: Name, ID and Contact numberInsert last (already done)Display All (already done)Insert at the beginningDelete the first elementDelete the last elementSearch an element (by ID)Insert after an elementDisplay how many elements are there in the listFind the element with highest (biggest) IDFind the element with lowest (smallest) ID // main file
  • 3. please solve all it ... Thank You :) Instead of ID and GPA, now consider following fields: Name, ID and Contact numberInsert last (already done)Display All (already done)Insert at the beginningDelete the first elementDelete the last elementSearch an element (by ID)Insert after an elementDisplay how many elements are there in the listFind the element with highest (biggest) IDFind the element with lowest (smallest) ID // main file
  • 4. please solve all it ... Thank You :) // main file please solve all it ... Thank You :) Solution // main file #include
  • 5. #include using namespace std; struct node{ //change to name , ID and contact number string name; int ID; ; string phone; //double GPA; node *link; }; node *head=NULL, *t; void insertNode() { node *temp=new node; cout<<"Enter name.."; cin>>temp->name; cout<<"Enter the ID.."; cin>>temp->ID; cout<<"Enter Phone.."; cin>>temp->phone; temp->link=NULL; if(head==NULL)//list is empty { head=temp; } else { t=head; while(t->link!=NULL) t=t->link; t->link=temp; } } void displayAll() { node *t=head;
  • 6. while(t!=NULL) { cout<<"Name="<name<ID<phone<link; } } void isertAtbegin() { node *cur = head; node *temp=new node; cout<<"Enter name.."; cin>>temp->name; cout<<"Enter the ID.."; cin>>temp->ID; cout<<"Enter Phone.."; cin>>temp->phone; head = temp; temp->link = cur; } void deleteFirstElement() { node *cur = head,*prev=head; head = head->link; free(cur); } void searchElement(int ID) { node *cur = head; int found = 0,pos=0; while( cur!=NULL) { if( ID == cur->ID ) { found = 1; break; }
  • 7. cur = cur->link; ++pos; } if( found ) cout<<"Element with Id= "<link; node *temp=new node; cout<<"Enter name.."; cin>>temp->name; cout<<"Enter the ID.."; cin>>temp->ID; cout<<"Enter Phone.."; cin>>temp->phone; temp->link=next; cur->link = temp; break; } cur = cur->link; ++pos; } } void displayNumberOfelements() { node *cur = head; int count = 0; while( cur!=NULL) { ++count; cur = cur->link; } cout<<"Number of elements in list = "<ID; while( cur!=NULL) { if(max < cur ->ID) { max = cur ->ID; }
  • 8. cur = cur->link; } cout<<"The element with highest (biggest) ID = "<ID; while( cur!=NULL) { if(min > cur ->ID) { min = cur ->ID; } cur = cur->link; } cout<<"the element with lowest (smallest) ID = "<>choice; if(choice==1) insertNode(); if(choice==2) displayAll(); if(choice==3) isertAtbegin(); if(choice==4) deleteFirstElement(); if(choice==5) searchElement(12); if(choice==6) insertAfterElement(2); if(choice==7) displayNumberOfelements(); if(choice==8) highestId(); if(choice==9) LowestId(); }//while loop return 0 ; }