SlideShare a Scribd company logo
1 of 2
Download to read offline
Answer:
#include
using namespace std;
struct NodeType
{
int info ;
NodeType* link ;
};
int main()
{
NodeType* ptr ;
NodeType* list ;
list = new NodeType;
list->info = 20;
ptr = new NodeType;
ptr->info = 15;
ptr->link = NULL;
list->link = ptr;
ptr = new NodeType;
ptr->info = 28;
ptr->link = list->link;
list->link = ptr;
ptr = list;
while (ptr != NULL)
{
cout << ptr->info << endl;
ptr = ptr->link;
}
}
Output After Execution Of The Program As Below :
20 28 15
Solution
Answer:
#include
using namespace std;
struct NodeType
{
int info ;
NodeType* link ;
};
int main()
{
NodeType* ptr ;
NodeType* list ;
list = new NodeType;
list->info = 20;
ptr = new NodeType;
ptr->info = 15;
ptr->link = NULL;
list->link = ptr;
ptr = new NodeType;
ptr->info = 28;
ptr->link = list->link;
list->link = ptr;
ptr = list;
while (ptr != NULL)
{
cout << ptr->info << endl;
ptr = ptr->link;
}
}
Output After Execution Of The Program As Below :
20 28 15

More Related Content

Similar to Answer#include iostream using namespace std;struct NodeType.pdf

This assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfThis assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdf
EricvtJFraserr
 
computer notes - Data Structures - 3
computer notes - Data Structures - 3computer notes - Data Structures - 3
computer notes - Data Structures - 3
ecomputernotes
 
include ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdfinclude ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdf
naslin841216
 
Main-cpp #include -iostream- #include -List-h- int main() { retur.pdf
Main-cpp  #include -iostream- #include -List-h- int main() {     retur.pdfMain-cpp  #include -iostream- #include -List-h- int main() {     retur.pdf
Main-cpp #include -iostream- #include -List-h- int main() { retur.pdf
PeterM9sWhitej
 
FP 201 - Unit 6
FP 201 - Unit 6FP 201 - Unit 6
FP 201 - Unit 6
rohassanie
 
Data structures cs301 power point slides lecture 03
Data structures   cs301 power point slides lecture 03Data structures   cs301 power point slides lecture 03
Data structures cs301 power point slides lecture 03
Nasir Mehmood
 
Consider a double-linked linked list implementation with the followin.pdf
Consider a double-linked linked list implementation with the followin.pdfConsider a double-linked linked list implementation with the followin.pdf
Consider a double-linked linked list implementation with the followin.pdf
sales98
 
Using C++ use a linked list to create an alphabetical Conta.pdf
Using C++ use a linked list to create an alphabetical Conta.pdfUsing C++ use a linked list to create an alphabetical Conta.pdf
Using C++ use a linked list to create an alphabetical Conta.pdf
picscamshoppe
 
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
AdrianEBJKingr
 
include ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdfinclude ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdf
aathmiboutique
 

Similar to Answer#include iostream using namespace std;struct NodeType.pdf (20)

Linked Stack program.docx
Linked Stack program.docxLinked Stack program.docx
Linked Stack program.docx
 
This assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfThis assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdf
 
computer notes - Data Structures - 3
computer notes - Data Structures - 3computer notes - Data Structures - 3
computer notes - Data Structures - 3
 
Use C++class Node{public   Node ( int = 0 );       constru.pdf
Use C++class Node{public   Node ( int = 0 );        constru.pdfUse C++class Node{public   Node ( int = 0 );        constru.pdf
Use C++class Node{public   Node ( int = 0 );       constru.pdf
 
Linked list
Linked listLinked list
Linked list
 
dynamicList.ppt
dynamicList.pptdynamicList.ppt
dynamicList.ppt
 
include ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdfinclude ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdf
 
Main-cpp #include -iostream- #include -List-h- int main() { retur.pdf
Main-cpp  #include -iostream- #include -List-h- int main() {     retur.pdfMain-cpp  #include -iostream- #include -List-h- int main() {     retur.pdf
Main-cpp #include -iostream- #include -List-h- int main() { retur.pdf
 
FP 201 - Unit 6
FP 201 - Unit 6FP 201 - Unit 6
FP 201 - Unit 6
 
Linked lists a
Linked lists aLinked lists a
Linked lists a
 
Data Structures and Agorithm: DS 05 Doubly Linked List.pptx
Data Structures and Agorithm: DS 05 Doubly Linked List.pptxData Structures and Agorithm: DS 05 Doubly Linked List.pptx
Data Structures and Agorithm: DS 05 Doubly Linked List.pptx
 
Data structures cs301 power point slides lecture 03
Data structures   cs301 power point slides lecture 03Data structures   cs301 power point slides lecture 03
Data structures cs301 power point slides lecture 03
 
Consider a double-linked linked list implementation with the followin.pdf
Consider a double-linked linked list implementation with the followin.pdfConsider a double-linked linked list implementation with the followin.pdf
Consider a double-linked linked list implementation with the followin.pdf
 
Using C++ use a linked list to create an alphabetical Conta.pdf
Using C++ use a linked list to create an alphabetical Conta.pdfUsing C++ use a linked list to create an alphabetical Conta.pdf
Using C++ use a linked list to create an alphabetical Conta.pdf
 
Implement the insertFirst member function of the LinkedList class . .pdf
Implement the insertFirst member function of the LinkedList class . .pdfImplement the insertFirst member function of the LinkedList class . .pdf
Implement the insertFirst member function of the LinkedList class . .pdf
 
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
 
Write a program to implement below operations with both singly and d.pdf
Write a program to implement below operations with both singly and d.pdfWrite a program to implement below operations with both singly and d.pdf
Write a program to implement below operations with both singly and d.pdf
 
Linked lists
Linked listsLinked lists
Linked lists
 
Lab Week 2 Game Programming.docx
Lab Week 2 Game Programming.docxLab Week 2 Game Programming.docx
Lab Week 2 Game Programming.docx
 
include ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdfinclude ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdf
 

More from arasanmobiles

1. The evolution of transportation has generally led to changes in u.pdf
1. The evolution of transportation has generally led to changes in u.pdf1. The evolution of transportation has generally led to changes in u.pdf
1. The evolution of transportation has generally led to changes in u.pdf
arasanmobiles
 
1) Name four properties of an OpenFileDialog that we often set prior.pdf
1) Name four properties of an OpenFileDialog that we often set prior.pdf1) Name four properties of an OpenFileDialog that we often set prior.pdf
1) Name four properties of an OpenFileDialog that we often set prior.pdf
arasanmobiles
 
Main File (usestudentacc.cpp)#includeiostream #include .pdf
 Main File (usestudentacc.cpp)#includeiostream #include .pdf Main File (usestudentacc.cpp)#includeiostream #include .pdf
Main File (usestudentacc.cpp)#includeiostream #include .pdf
arasanmobiles
 
DBA Company Income Statement For the period ended December 31,.pdf
    DBA Company   Income Statement   For the period ended December 31,.pdf    DBA Company   Income Statement   For the period ended December 31,.pdf
DBA Company Income Statement For the period ended December 31,.pdf
arasanmobiles
 
Phenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdf
Phenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdfPhenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdf
Phenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdf
arasanmobiles
 
Yes both men and women differ in their thinking, research has proved.pdf
Yes both men and women differ in their thinking, research has proved.pdfYes both men and women differ in their thinking, research has proved.pdf
Yes both men and women differ in their thinking, research has proved.pdf
arasanmobiles
 
When using some Sounds and Audio Devices functions you see a message.pdf
When using some Sounds and Audio Devices functions you see a message.pdfWhen using some Sounds and Audio Devices functions you see a message.pdf
When using some Sounds and Audio Devices functions you see a message.pdf
arasanmobiles
 
The racial and ethnic makeup of the American people is in flux. New .pdf
The racial and ethnic makeup of the American people is in flux. New .pdfThe racial and ethnic makeup of the American people is in flux. New .pdf
The racial and ethnic makeup of the American people is in flux. New .pdf
arasanmobiles
 
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdfoperating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
arasanmobiles
 

More from arasanmobiles (20)

a) Here, H2PO4- Acts as acid and HPO42- as salt.In equation pKa of.pdf
a) Here, H2PO4- Acts as acid and HPO42- as salt.In equation pKa of.pdfa) Here, H2PO4- Acts as acid and HPO42- as salt.In equation pKa of.pdf
a) Here, H2PO4- Acts as acid and HPO42- as salt.In equation pKa of.pdf
 
1. The evolution of transportation has generally led to changes in u.pdf
1. The evolution of transportation has generally led to changes in u.pdf1. The evolution of transportation has generally led to changes in u.pdf
1. The evolution of transportation has generally led to changes in u.pdf
 
1) Transition state 2) Threshold energy 3) Catalysts or Intermed.pdf
1) Transition state 2) Threshold energy 3) Catalysts or Intermed.pdf1) Transition state 2) Threshold energy 3) Catalysts or Intermed.pdf
1) Transition state 2) Threshold energy 3) Catalysts or Intermed.pdf
 
1) Name four properties of an OpenFileDialog that we often set prior.pdf
1) Name four properties of an OpenFileDialog that we often set prior.pdf1) Name four properties of an OpenFileDialog that we often set prior.pdf
1) Name four properties of an OpenFileDialog that we often set prior.pdf
 
Main File (usestudentacc.cpp)#includeiostream #include .pdf
 Main File (usestudentacc.cpp)#includeiostream #include .pdf Main File (usestudentacc.cpp)#includeiostream #include .pdf
Main File (usestudentacc.cpp)#includeiostream #include .pdf
 
Ecell = Eocell - (0.0592n)log (more dilute solnmore concd soln). .pdf
  Ecell = Eocell - (0.0592n)log (more dilute solnmore concd soln). .pdf  Ecell = Eocell - (0.0592n)log (more dilute solnmore concd soln). .pdf
Ecell = Eocell - (0.0592n)log (more dilute solnmore concd soln). .pdf
 
DBA Company Income Statement For the period ended December 31,.pdf
    DBA Company   Income Statement   For the period ended December 31,.pdf    DBA Company   Income Statement   For the period ended December 31,.pdf
DBA Company Income Statement For the period ended December 31,.pdf
 
Indicate whether the solute solid is generally so.pdf
                     Indicate whether the solute solid is generally so.pdf                     Indicate whether the solute solid is generally so.pdf
Indicate whether the solute solid is generally so.pdf
 
in HCl [H+] concentration = 0.12M pH of HCl = -lo.pdf
                     in HCl [H+] concentration = 0.12M pH of HCl = -lo.pdf                     in HCl [H+] concentration = 0.12M pH of HCl = -lo.pdf
in HCl [H+] concentration = 0.12M pH of HCl = -lo.pdf
 
Phenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdf
Phenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdfPhenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdf
Phenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdf
 
B. When dissolved solute and undissolved solute e.pdf
                     B. When dissolved solute and undissolved solute e.pdf                     B. When dissolved solute and undissolved solute e.pdf
B. When dissolved solute and undissolved solute e.pdf
 
Yes both men and women differ in their thinking, research has proved.pdf
Yes both men and women differ in their thinking, research has proved.pdfYes both men and women differ in their thinking, research has proved.pdf
Yes both men and women differ in their thinking, research has proved.pdf
 
What is the probability that a five-card poker hand contains the a.pdf
What is the probability that a five-card poker hand contains the a.pdfWhat is the probability that a five-card poker hand contains the a.pdf
What is the probability that a five-card poker hand contains the a.pdf
 
When using some Sounds and Audio Devices functions you see a message.pdf
When using some Sounds and Audio Devices functions you see a message.pdfWhen using some Sounds and Audio Devices functions you see a message.pdf
When using some Sounds and Audio Devices functions you see a message.pdf
 
We can better understand it with the help of examples.Red flower -.pdf
We can better understand it with the help of examples.Red flower -.pdfWe can better understand it with the help of examples.Red flower -.pdf
We can better understand it with the help of examples.Red flower -.pdf
 
The racial and ethnic makeup of the American people is in flux. New .pdf
The racial and ethnic makeup of the American people is in flux. New .pdfThe racial and ethnic makeup of the American people is in flux. New .pdf
The racial and ethnic makeup of the American people is in flux. New .pdf
 
The ion responsible is HCO3-.HCO3- is the conjugate base of the we.pdf
The ion responsible is HCO3-.HCO3- is the conjugate base of the we.pdfThe ion responsible is HCO3-.HCO3- is the conjugate base of the we.pdf
The ion responsible is HCO3-.HCO3- is the conjugate base of the we.pdf
 
The causal relationship in epidemiology is generally an observation .pdf
The causal relationship in epidemiology is generally an observation .pdfThe causal relationship in epidemiology is generally an observation .pdf
The causal relationship in epidemiology is generally an observation .pdf
 
Since Lithium sulfate is an ionic compound and is soluble in water, .pdf
Since Lithium sulfate is an ionic compound and is soluble in water, .pdfSince Lithium sulfate is an ionic compound and is soluble in water, .pdf
Since Lithium sulfate is an ionic compound and is soluble in water, .pdf
 
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdfoperating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 

Recently uploaded (20)

Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 

Answer#include iostream using namespace std;struct NodeType.pdf

  • 1. Answer: #include using namespace std; struct NodeType { int info ; NodeType* link ; }; int main() { NodeType* ptr ; NodeType* list ; list = new NodeType; list->info = 20; ptr = new NodeType; ptr->info = 15; ptr->link = NULL; list->link = ptr; ptr = new NodeType; ptr->info = 28; ptr->link = list->link; list->link = ptr; ptr = list; while (ptr != NULL) { cout << ptr->info << endl; ptr = ptr->link; } } Output After Execution Of The Program As Below : 20 28 15 Solution Answer:
  • 2. #include using namespace std; struct NodeType { int info ; NodeType* link ; }; int main() { NodeType* ptr ; NodeType* list ; list = new NodeType; list->info = 20; ptr = new NodeType; ptr->info = 15; ptr->link = NULL; list->link = ptr; ptr = new NodeType; ptr->info = 28; ptr->link = list->link; list->link = ptr; ptr = list; while (ptr != NULL) { cout << ptr->info << endl; ptr = ptr->link; } } Output After Execution Of The Program As Below : 20 28 15