SlideShare a Scribd company logo
1 of 1
Download to read offline
Nrite the definition of the function insertBack( ) as a member function of the class AnyList as -
Parameter: An int storing a value. - The function creates a new node that stores the value passed
by the parameter, and inse new node at the end of the list. Make sure you use the initializer list
constructor. This way, you will be using only one functic vhich is more efficiend than using two
(default constructor + setData). Functions.cpp Running Main.cpp Actual Expected List 1: List is
empty. List 1: List is empty. List 2: 2 List 3: 75 List 4: 84209 List 5: 12034 2 5 7 8 fail How to
Insert Nodes to the End of the List To insert a node at the end of a list that has several nodes, you
will need to: 1. Create a new node storing the data given. 2. Traverse the list and stop when you
reach the last node. - The efficient way to do so is by using a counter. 3. Connect pointer next of
the last node to the new node. 4. Update the member variable count.

More Related Content

Similar to Nrite the definition of the function insertBack( ) as a member functio.pdf

C++ Please test your program before you submit the answer.pdf
C++ Please test your program before you submit the answer.pdfC++ Please test your program before you submit the answer.pdf
C++ Please test your program before you submit the answer.pdf
aashisha5
 
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docxAssg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
festockton
 
Background Circular Linked List A circular linked list is .pdf
Background Circular Linked List A circular linked list is .pdfBackground Circular Linked List A circular linked list is .pdf
Background Circular Linked List A circular linked list is .pdf
aaseletronics2013
 
Complete a C++ class implementation for a linked-list of sorted (asc.pdf
Complete a C++ class implementation for a linked-list of sorted (asc.pdfComplete a C++ class implementation for a linked-list of sorted (asc.pdf
Complete a C++ class implementation for a linked-list of sorted (asc.pdf
shahidqamar17
 
Please help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdfPlease help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdf
ankit11134
 
C++ Background Circular Linked List A circular linked list.pdf
C++ Background Circular Linked List A circular linked list.pdfC++ Background Circular Linked List A circular linked list.pdf
C++ Background Circular Linked List A circular linked list.pdf
saradashata
 
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
 
Write a Java Class to Implement a Generic Linked ListYour list mus.pdf
Write a Java Class to Implement a Generic Linked ListYour list mus.pdfWrite a Java Class to Implement a Generic Linked ListYour list mus.pdf
Write a Java Class to Implement a Generic Linked ListYour list mus.pdf
rozakashif85
 
2. numanalysis.py ( 30 points) A) Write a program that asks user to e.pdf
 2. numanalysis.py ( 30 points) A) Write a program that asks user to e.pdf 2. numanalysis.py ( 30 points) A) Write a program that asks user to e.pdf
2. numanalysis.py ( 30 points) A) Write a program that asks user to e.pdf
allwayscollection
 
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdfIn C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
stopgolook
 
package linkedLists- import java-util-Iterator- --- A class representi.pdf
package linkedLists- import java-util-Iterator- --- A class representi.pdfpackage linkedLists- import java-util-Iterator- --- A class representi.pdf
package linkedLists- import java-util-Iterator- --- A class representi.pdf
arcellzone
 

Similar to Nrite the definition of the function insertBack( ) as a member functio.pdf (20)

Data Structures with C Linked List
Data Structures with C Linked ListData Structures with C Linked List
Data Structures with C Linked List
 
C++ Please test your program before you submit the answer.pdf
C++ Please test your program before you submit the answer.pdfC++ Please test your program before you submit the answer.pdf
C++ Please test your program before you submit the answer.pdf
 
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docxAssg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
 
Algo>ADT list & linked list
Algo>ADT list & linked listAlgo>ADT list & linked list
Algo>ADT list & linked list
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]
 
Ch17
Ch17Ch17
Ch17
 
Linked lists in Data Structure
Linked lists in Data StructureLinked lists in Data Structure
Linked lists in Data Structure
 
Background Circular Linked List A circular linked list is .pdf
Background Circular Linked List A circular linked list is .pdfBackground Circular Linked List A circular linked list is .pdf
Background Circular Linked List A circular linked list is .pdf
 
Linked List Presentation in data structurepptx
Linked List Presentation in data structurepptxLinked List Presentation in data structurepptx
Linked List Presentation in data structurepptx
 
Complete a C++ class implementation for a linked-list of sorted (asc.pdf
Complete a C++ class implementation for a linked-list of sorted (asc.pdfComplete a C++ class implementation for a linked-list of sorted (asc.pdf
Complete a C++ class implementation for a linked-list of sorted (asc.pdf
 
Please help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdfPlease help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdf
 
Data Structure.pdf
Data Structure.pdfData Structure.pdf
Data Structure.pdf
 
C++ Background Circular Linked List A circular linked list.pdf
C++ Background Circular Linked List A circular linked list.pdfC++ Background Circular Linked List A circular linked list.pdf
C++ Background Circular Linked List A circular linked list.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
 
Basic data structures in python
Basic data structures in pythonBasic data structures in python
Basic data structures in python
 
Write a Java Class to Implement a Generic Linked ListYour list mus.pdf
Write a Java Class to Implement a Generic Linked ListYour list mus.pdfWrite a Java Class to Implement a Generic Linked ListYour list mus.pdf
Write a Java Class to Implement a Generic Linked ListYour list mus.pdf
 
2. numanalysis.py ( 30 points) A) Write a program that asks user to e.pdf
 2. numanalysis.py ( 30 points) A) Write a program that asks user to e.pdf 2. numanalysis.py ( 30 points) A) Write a program that asks user to e.pdf
2. numanalysis.py ( 30 points) A) Write a program that asks user to e.pdf
 
Stack
StackStack
Stack
 
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdfIn C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
 
package linkedLists- import java-util-Iterator- --- A class representi.pdf
package linkedLists- import java-util-Iterator- --- A class representi.pdfpackage linkedLists- import java-util-Iterator- --- A class representi.pdf
package linkedLists- import java-util-Iterator- --- A class representi.pdf
 

More from Edwardw5nSlaterl

On January 19- I sent an announcement about the different types of law.pdf
On January 19- I sent an announcement about the different types of law.pdfOn January 19- I sent an announcement about the different types of law.pdf
On January 19- I sent an announcement about the different types of law.pdf
Edwardw5nSlaterl
 

More from Edwardw5nSlaterl (20)

On January 19- I sent an announcement about the different types of law.pdf
On January 19- I sent an announcement about the different types of law.pdfOn January 19- I sent an announcement about the different types of law.pdf
On January 19- I sent an announcement about the different types of law.pdf
 
On January 31- a snowstorm damaged the office of a small business- and (3).pdf
On January 31- a snowstorm damaged the office of a small business- and (3).pdfOn January 31- a snowstorm damaged the office of a small business- and (3).pdf
On January 31- a snowstorm damaged the office of a small business- and (3).pdf
 
On June 1- 2013- May and Nora formed a partnership- May is to invest a.pdf
On June 1- 2013- May and Nora formed a partnership- May is to invest a.pdfOn June 1- 2013- May and Nora formed a partnership- May is to invest a.pdf
On June 1- 2013- May and Nora formed a partnership- May is to invest a.pdf
 
On January 4- 2019- the DJIA opened at 11-739-19- The divisor at that.pdf
On January 4- 2019- the DJIA opened at 11-739-19- The divisor at that.pdfOn January 4- 2019- the DJIA opened at 11-739-19- The divisor at that.pdf
On January 4- 2019- the DJIA opened at 11-739-19- The divisor at that.pdf
 
On January 1-1988- Antonio invests $9-400 in an investment fund- On Ja.pdf
On January 1-1988- Antonio invests $9-400 in an investment fund- On Ja.pdfOn January 1-1988- Antonio invests $9-400 in an investment fund- On Ja.pdf
On January 1-1988- Antonio invests $9-400 in an investment fund- On Ja.pdf
 
On January 1- Southwest College received $1-270-000 in Unearned Tuitio.pdf
On January 1- Southwest College received $1-270-000 in Unearned Tuitio.pdfOn January 1- Southwest College received $1-270-000 in Unearned Tuitio.pdf
On January 1- Southwest College received $1-270-000 in Unearned Tuitio.pdf
 
On January 1- 2020- Pharoah Corporation had 96-000 shares of no-par co.pdf
On January 1- 2020- Pharoah Corporation had 96-000 shares of no-par co.pdfOn January 1- 2020- Pharoah Corporation had 96-000 shares of no-par co.pdf
On January 1- 2020- Pharoah Corporation had 96-000 shares of no-par co.pdf
 
On January 1- 2020- A- B and C establish a joint undertaking to manufa.pdf
On January 1- 2020- A- B and C establish a joint undertaking to manufa.pdfOn January 1- 2020- A- B and C establish a joint undertaking to manufa.pdf
On January 1- 2020- A- B and C establish a joint undertaking to manufa.pdf
 
On January 1 - Daniel borrows $5100 with a fixed annual interest rate.pdf
On January 1 - Daniel borrows $5100 with a fixed annual interest rate.pdfOn January 1 - Daniel borrows $5100 with a fixed annual interest rate.pdf
On January 1 - Daniel borrows $5100 with a fixed annual interest rate.pdf
 
On fune 1- 20v7- Young Corporation paid $20-000 cash for machinery tha.pdf
On fune 1- 20v7- Young Corporation paid $20-000 cash for machinery tha.pdfOn fune 1- 20v7- Young Corporation paid $20-000 cash for machinery tha.pdf
On fune 1- 20v7- Young Corporation paid $20-000 cash for machinery tha.pdf
 
On February 1- 2023- Tessa Williams and Audrey Xie formed a partnershi.pdf
On February 1- 2023- Tessa Williams and Audrey Xie formed a partnershi.pdfOn February 1- 2023- Tessa Williams and Audrey Xie formed a partnershi.pdf
On February 1- 2023- Tessa Williams and Audrey Xie formed a partnershi.pdf
 
Objective Take user inputs and add them to the nested dictionary data.pdf
Objective Take user inputs and add them to the nested dictionary data.pdfObjective Take user inputs and add them to the nested dictionary data.pdf
Objective Take user inputs and add them to the nested dictionary data.pdf
 
On December 31- 20X1- the ledger of Lopez Company contained the follow.pdf
On December 31- 20X1- the ledger of Lopez Company contained the follow.pdfOn December 31- 20X1- the ledger of Lopez Company contained the follow.pdf
On December 31- 20X1- the ledger of Lopez Company contained the follow.pdf
 
OK- here we are with Covid-19 and flu- and the rise of other diseases.pdf
OK- here we are with Covid-19 and flu- and the rise of other diseases.pdfOK- here we are with Covid-19 and flu- and the rise of other diseases.pdf
OK- here we are with Covid-19 and flu- and the rise of other diseases.pdf
 
Of the adult population in the United States- 47- have hypertension- A.pdf
Of the adult population in the United States- 47- have hypertension- A.pdfOf the adult population in the United States- 47- have hypertension- A.pdf
Of the adult population in the United States- 47- have hypertension- A.pdf
 
Obtain the demand functions of x and y for the following utility funct.pdf
Obtain the demand functions of x and y for the following utility funct.pdfObtain the demand functions of x and y for the following utility funct.pdf
Obtain the demand functions of x and y for the following utility funct.pdf
 
Obtain a copy of the City of Orlando government's annual operating bud.pdf
Obtain a copy of the City of Orlando government's annual operating bud.pdfObtain a copy of the City of Orlando government's annual operating bud.pdf
Obtain a copy of the City of Orlando government's annual operating bud.pdf
 
Obtain a copy of the City of Orlando government's annual operating bud (1).pdf
Obtain a copy of the City of Orlando government's annual operating bud (1).pdfObtain a copy of the City of Orlando government's annual operating bud (1).pdf
Obtain a copy of the City of Orlando government's annual operating bud (1).pdf
 
Obtain a copy of the City of Orlando government's annual operating bud (4).pdf
Obtain a copy of the City of Orlando government's annual operating bud (4).pdfObtain a copy of the City of Orlando government's annual operating bud (4).pdf
Obtain a copy of the City of Orlando government's annual operating bud (4).pdf
 
Obtain a copy of the City of Orlando government's annual operating bud (2).pdf
Obtain a copy of the City of Orlando government's annual operating bud (2).pdfObtain a copy of the City of Orlando government's annual operating bud (2).pdf
Obtain a copy of the City of Orlando government's annual operating bud (2).pdf
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

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
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
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
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
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...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
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
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 

Nrite the definition of the function insertBack( ) as a member functio.pdf

  • 1. Nrite the definition of the function insertBack( ) as a member function of the class AnyList as - Parameter: An int storing a value. - The function creates a new node that stores the value passed by the parameter, and inse new node at the end of the list. Make sure you use the initializer list constructor. This way, you will be using only one functic vhich is more efficiend than using two (default constructor + setData). Functions.cpp Running Main.cpp Actual Expected List 1: List is empty. List 1: List is empty. List 2: 2 List 3: 75 List 4: 84209 List 5: 12034 2 5 7 8 fail How to Insert Nodes to the End of the List To insert a node at the end of a list that has several nodes, you will need to: 1. Create a new node storing the data given. 2. Traverse the list and stop when you reach the last node. - The efficient way to do so is by using a counter. 3. Connect pointer next of the last node to the new node. 4. Update the member variable count.