SlideShare a Scribd company logo
1 of 2
Download to read offline
In this exercise, we are going to finish the implementation of a special type of LinkedList called
a StringList. The purpose of this exercise is to get you comfortable with LinkedList behavior and
manipulations (without having to worry about generic types).
See the attached files: • StringList.cpp • StringList.h
• Shopping.cpp
This is a simple linked list that stores strings. It supports some basic operations.
Your job is to implement all of the unimplemented functions in StringList.cpp, namely:
• voidappend(conststd::string&)
o Appends a new string to the end of the list
• boolcontains(conststd::string&)
o Returns TRUE if string is in list, else returns FALSE
• intsize()
o Returns the number of elements in the list (or 0 if there are none)
• voiddeleteAll()
o Removes all list elements, freeing all dynamically allocated memory
• std::stringget(constint&)
o Returns the string at the location specified
o If the location referenced does not exist, throws an exception
Before getting started on this project, make sure the sample compiles for you and that you can
run it. (it should produce output).
When you have completed your work, it will produce the following:
Solution
for apeend try this
for searching a particular node
{
struct node* current = head; // Initialize current
while (current != NULL)
{
if (current->key == x)
return true;
current = current->next;
}
return false;
}
for size of linked list
for deletion
returns string at specified location
//this is similar to search operation
struct node* current = head; // Initialize current
while (current != NULL)
{
if (current->key == x)
return true;
return x->data;
current = current->next;
}
return false;
}

More Related Content

Similar to In this exercise, we are going to finish the implementation of a spe.pdf

01-intro_stacks.ppt
01-intro_stacks.ppt01-intro_stacks.ppt
01-intro_stacks.pptsoniya555961
 
C++ Standard Template Library
C++ Standard Template LibraryC++ Standard Template Library
C++ Standard Template LibraryIlio Catallo
 
Scala collections api expressivity and brevity upgrade from java
Scala collections api  expressivity and brevity upgrade from javaScala collections api  expressivity and brevity upgrade from java
Scala collections api expressivity and brevity upgrade from javaIndicThreads
 
My lecture stack_queue_operation
My lecture stack_queue_operationMy lecture stack_queue_operation
My lecture stack_queue_operationSenthil Kumar
 
L11 array list
L11 array listL11 array list
L11 array listteach4uin
 
you will implement some sorting algorithms for arrays and linked lis.pdf
you will implement some sorting algorithms for arrays and linked lis.pdfyou will implement some sorting algorithms for arrays and linked lis.pdf
you will implement some sorting algorithms for arrays and linked lis.pdfclearvisioneyecareno
 
stacks and queues class 12 in c++
stacks and  queues class 12 in c++stacks and  queues class 12 in c++
stacks and queues class 12 in c++Khushal Mehta
 
Java10 Collections and Information
Java10 Collections and InformationJava10 Collections and Information
Java10 Collections and InformationSoftNutx
 
Assg 14 C++ Standard Template Library (STL)(Extra Credit .docx
Assg 14 C++ Standard Template Library (STL)(Extra Credit .docxAssg 14 C++ Standard Template Library (STL)(Extra Credit .docx
Assg 14 C++ Standard Template Library (STL)(Extra Credit .docxfestockton
 
computer notes - Data Structures - 5
computer notes - Data Structures - 5computer notes - Data Structures - 5
computer notes - Data Structures - 5ecomputernotes
 
ObjectivesMore practice with recursion.Practice writing some tem.docx
ObjectivesMore practice with recursion.Practice writing some tem.docxObjectivesMore practice with recursion.Practice writing some tem.docx
ObjectivesMore practice with recursion.Practice writing some tem.docxvannagoforth
 

Similar to In this exercise, we are going to finish the implementation of a spe.pdf (20)

Python Basics
Python BasicsPython Basics
Python Basics
 
01-intro_stacks.ppt
01-intro_stacks.ppt01-intro_stacks.ppt
01-intro_stacks.ppt
 
C++ Standard Template Library
C++ Standard Template LibraryC++ Standard Template Library
C++ Standard Template Library
 
Scala collections api expressivity and brevity upgrade from java
Scala collections api  expressivity and brevity upgrade from javaScala collections api  expressivity and brevity upgrade from java
Scala collections api expressivity and brevity upgrade from java
 
Day2
Day2Day2
Day2
 
My lecture stack_queue_operation
My lecture stack_queue_operationMy lecture stack_queue_operation
My lecture stack_queue_operation
 
L11 array list
L11 array listL11 array list
L11 array list
 
you will implement some sorting algorithms for arrays and linked lis.pdf
you will implement some sorting algorithms for arrays and linked lis.pdfyou will implement some sorting algorithms for arrays and linked lis.pdf
you will implement some sorting algorithms for arrays and linked lis.pdf
 
stacks and queues class 12 in c++
stacks and  queues class 12 in c++stacks and  queues class 12 in c++
stacks and queues class 12 in c++
 
Stack in Sata Structure
Stack in Sata StructureStack in Sata Structure
Stack in Sata Structure
 
Java10 Collections and Information
Java10 Collections and InformationJava10 Collections and Information
Java10 Collections and Information
 
6
66
6
 
Assg 14 C++ Standard Template Library (STL)(Extra Credit .docx
Assg 14 C++ Standard Template Library (STL)(Extra Credit .docxAssg 14 C++ Standard Template Library (STL)(Extra Credit .docx
Assg 14 C++ Standard Template Library (STL)(Extra Credit .docx
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Collections
CollectionsCollections
Collections
 
05 c++-strings
05 c++-strings05 c++-strings
05 c++-strings
 
computer notes - Data Structures - 5
computer notes - Data Structures - 5computer notes - Data Structures - 5
computer notes - Data Structures - 5
 
Collections and generics
Collections and genericsCollections and generics
Collections and generics
 
STRINGS IN JAVA
STRINGS IN JAVASTRINGS IN JAVA
STRINGS IN JAVA
 
ObjectivesMore practice with recursion.Practice writing some tem.docx
ObjectivesMore practice with recursion.Practice writing some tem.docxObjectivesMore practice with recursion.Practice writing some tem.docx
ObjectivesMore practice with recursion.Practice writing some tem.docx
 

More from aimdeals045

Infection of bacteria by virus particles is a Poisson process.  Viru.pdf
Infection of bacteria by virus particles is a Poisson process.  Viru.pdfInfection of bacteria by virus particles is a Poisson process.  Viru.pdf
Infection of bacteria by virus particles is a Poisson process.  Viru.pdfaimdeals045
 
inequalityi dont know if the inequality is changing when solving.pdf
inequalityi dont know if the inequality is changing when solving.pdfinequalityi dont know if the inequality is changing when solving.pdf
inequalityi dont know if the inequality is changing when solving.pdfaimdeals045
 
Individuals that continually monitor the financial markets seeking m.pdf
Individuals that continually monitor the financial markets seeking m.pdfIndividuals that continually monitor the financial markets seeking m.pdf
Individuals that continually monitor the financial markets seeking m.pdfaimdeals045
 
indicate whether you agree with the following statement that describ.pdf
indicate whether you agree with the following statement that describ.pdfindicate whether you agree with the following statement that describ.pdf
indicate whether you agree with the following statement that describ.pdfaimdeals045
 
Indicate what data analysis is and why is it useful Think of how a .pdf
Indicate what data analysis is and why is it useful Think of how a .pdfIndicate what data analysis is and why is it useful Think of how a .pdf
Indicate what data analysis is and why is it useful Think of how a .pdfaimdeals045
 
Incompressible substances A and B are placed in a thermal contact in.pdf
Incompressible substances A and B are placed in a thermal contact in.pdfIncompressible substances A and B are placed in a thermal contact in.pdf
Incompressible substances A and B are placed in a thermal contact in.pdfaimdeals045
 
Inch Ltd. was incorporated in the Bahamas in 2011. Although the comp.pdf
Inch Ltd. was incorporated in the Bahamas in 2011. Although the comp.pdfInch Ltd. was incorporated in the Bahamas in 2011. Although the comp.pdf
Inch Ltd. was incorporated in the Bahamas in 2011. Although the comp.pdfaimdeals045
 
In-Class Exam Homework The college president is more interested in .pdf
In-Class Exam Homework The college president is more interested in .pdfIn-Class Exam Homework The college president is more interested in .pdf
In-Class Exam Homework The college president is more interested in .pdfaimdeals045
 
Income Statement (in million of USDs)2015Total sales202Cost .pdf
Income Statement (in million of USDs)2015Total sales202Cost .pdfIncome Statement (in million of USDs)2015Total sales202Cost .pdf
Income Statement (in million of USDs)2015Total sales202Cost .pdfaimdeals045
 
In your own words, what were the core intellectual, political, and a.pdf
In your own words, what were the core intellectual, political, and a.pdfIn your own words, what were the core intellectual, political, and a.pdf
In your own words, what were the core intellectual, political, and a.pdfaimdeals045
 
In your opinion, what are the biggest challenges facing MNCSolut.pdf
In your opinion, what are the biggest challenges facing MNCSolut.pdfIn your opinion, what are the biggest challenges facing MNCSolut.pdf
In your opinion, what are the biggest challenges facing MNCSolut.pdfaimdeals045
 
In words, what is the equation for normal stressSolutionA mea.pdf
In words, what is the equation for normal stressSolutionA mea.pdfIn words, what is the equation for normal stressSolutionA mea.pdf
In words, what is the equation for normal stressSolutionA mea.pdfaimdeals045
 
In which of the following remote access methods is a pinholing schem.pdf
In which of the following remote access methods is a pinholing schem.pdfIn which of the following remote access methods is a pinholing schem.pdf
In which of the following remote access methods is a pinholing schem.pdfaimdeals045
 
In what area does internal control allow only one person responsible.pdf
In what area does internal control allow only one person responsible.pdfIn what area does internal control allow only one person responsible.pdf
In what area does internal control allow only one person responsible.pdfaimdeals045
 
In todaySolution n the past it had been the .pdf
In todaySolution                     n the past it had been the .pdfIn todaySolution                     n the past it had been the .pdf
In todaySolution n the past it had been the .pdfaimdeals045
 
In this task, I want you to verify that the phase response of Fourie.pdf
In this task, I want you to verify that the phase response of Fourie.pdfIn this task, I want you to verify that the phase response of Fourie.pdf
In this task, I want you to verify that the phase response of Fourie.pdfaimdeals045
 
In this unit, you discussed some of the problems associated with inf.pdf
In this unit, you discussed some of the problems associated with inf.pdfIn this unit, you discussed some of the problems associated with inf.pdf
In this unit, you discussed some of the problems associated with inf.pdfaimdeals045
 
In this question i know the answer is an elliptic parabolid. My ques.pdf
In this question i know the answer is an elliptic parabolid. My ques.pdfIn this question i know the answer is an elliptic parabolid. My ques.pdf
In this question i know the answer is an elliptic parabolid. My ques.pdfaimdeals045
 
In this chapter a decision tree was developed for John Thompson (Fig.pdf
In this chapter a decision tree was developed for John Thompson (Fig.pdfIn this chapter a decision tree was developed for John Thompson (Fig.pdf
In this chapter a decision tree was developed for John Thompson (Fig.pdfaimdeals045
 
In this problem , I have to find the third derivative of the fourth .pdf
In this problem , I have to find the third derivative of the fourth .pdfIn this problem , I have to find the third derivative of the fourth .pdf
In this problem , I have to find the third derivative of the fourth .pdfaimdeals045
 

More from aimdeals045 (20)

Infection of bacteria by virus particles is a Poisson process.  Viru.pdf
Infection of bacteria by virus particles is a Poisson process.  Viru.pdfInfection of bacteria by virus particles is a Poisson process.  Viru.pdf
Infection of bacteria by virus particles is a Poisson process.  Viru.pdf
 
inequalityi dont know if the inequality is changing when solving.pdf
inequalityi dont know if the inequality is changing when solving.pdfinequalityi dont know if the inequality is changing when solving.pdf
inequalityi dont know if the inequality is changing when solving.pdf
 
Individuals that continually monitor the financial markets seeking m.pdf
Individuals that continually monitor the financial markets seeking m.pdfIndividuals that continually monitor the financial markets seeking m.pdf
Individuals that continually monitor the financial markets seeking m.pdf
 
indicate whether you agree with the following statement that describ.pdf
indicate whether you agree with the following statement that describ.pdfindicate whether you agree with the following statement that describ.pdf
indicate whether you agree with the following statement that describ.pdf
 
Indicate what data analysis is and why is it useful Think of how a .pdf
Indicate what data analysis is and why is it useful Think of how a .pdfIndicate what data analysis is and why is it useful Think of how a .pdf
Indicate what data analysis is and why is it useful Think of how a .pdf
 
Incompressible substances A and B are placed in a thermal contact in.pdf
Incompressible substances A and B are placed in a thermal contact in.pdfIncompressible substances A and B are placed in a thermal contact in.pdf
Incompressible substances A and B are placed in a thermal contact in.pdf
 
Inch Ltd. was incorporated in the Bahamas in 2011. Although the comp.pdf
Inch Ltd. was incorporated in the Bahamas in 2011. Although the comp.pdfInch Ltd. was incorporated in the Bahamas in 2011. Although the comp.pdf
Inch Ltd. was incorporated in the Bahamas in 2011. Although the comp.pdf
 
In-Class Exam Homework The college president is more interested in .pdf
In-Class Exam Homework The college president is more interested in .pdfIn-Class Exam Homework The college president is more interested in .pdf
In-Class Exam Homework The college president is more interested in .pdf
 
Income Statement (in million of USDs)2015Total sales202Cost .pdf
Income Statement (in million of USDs)2015Total sales202Cost .pdfIncome Statement (in million of USDs)2015Total sales202Cost .pdf
Income Statement (in million of USDs)2015Total sales202Cost .pdf
 
In your own words, what were the core intellectual, political, and a.pdf
In your own words, what were the core intellectual, political, and a.pdfIn your own words, what were the core intellectual, political, and a.pdf
In your own words, what were the core intellectual, political, and a.pdf
 
In your opinion, what are the biggest challenges facing MNCSolut.pdf
In your opinion, what are the biggest challenges facing MNCSolut.pdfIn your opinion, what are the biggest challenges facing MNCSolut.pdf
In your opinion, what are the biggest challenges facing MNCSolut.pdf
 
In words, what is the equation for normal stressSolutionA mea.pdf
In words, what is the equation for normal stressSolutionA mea.pdfIn words, what is the equation for normal stressSolutionA mea.pdf
In words, what is the equation for normal stressSolutionA mea.pdf
 
In which of the following remote access methods is a pinholing schem.pdf
In which of the following remote access methods is a pinholing schem.pdfIn which of the following remote access methods is a pinholing schem.pdf
In which of the following remote access methods is a pinholing schem.pdf
 
In what area does internal control allow only one person responsible.pdf
In what area does internal control allow only one person responsible.pdfIn what area does internal control allow only one person responsible.pdf
In what area does internal control allow only one person responsible.pdf
 
In todaySolution n the past it had been the .pdf
In todaySolution                     n the past it had been the .pdfIn todaySolution                     n the past it had been the .pdf
In todaySolution n the past it had been the .pdf
 
In this task, I want you to verify that the phase response of Fourie.pdf
In this task, I want you to verify that the phase response of Fourie.pdfIn this task, I want you to verify that the phase response of Fourie.pdf
In this task, I want you to verify that the phase response of Fourie.pdf
 
In this unit, you discussed some of the problems associated with inf.pdf
In this unit, you discussed some of the problems associated with inf.pdfIn this unit, you discussed some of the problems associated with inf.pdf
In this unit, you discussed some of the problems associated with inf.pdf
 
In this question i know the answer is an elliptic parabolid. My ques.pdf
In this question i know the answer is an elliptic parabolid. My ques.pdfIn this question i know the answer is an elliptic parabolid. My ques.pdf
In this question i know the answer is an elliptic parabolid. My ques.pdf
 
In this chapter a decision tree was developed for John Thompson (Fig.pdf
In this chapter a decision tree was developed for John Thompson (Fig.pdfIn this chapter a decision tree was developed for John Thompson (Fig.pdf
In this chapter a decision tree was developed for John Thompson (Fig.pdf
 
In this problem , I have to find the third derivative of the fourth .pdf
In this problem , I have to find the third derivative of the fourth .pdfIn this problem , I have to find the third derivative of the fourth .pdf
In this problem , I have to find the third derivative of the fourth .pdf
 

Recently uploaded

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Recently uploaded (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 

In this exercise, we are going to finish the implementation of a spe.pdf

  • 1. In this exercise, we are going to finish the implementation of a special type of LinkedList called a StringList. The purpose of this exercise is to get you comfortable with LinkedList behavior and manipulations (without having to worry about generic types). See the attached files: • StringList.cpp • StringList.h • Shopping.cpp This is a simple linked list that stores strings. It supports some basic operations. Your job is to implement all of the unimplemented functions in StringList.cpp, namely: • voidappend(conststd::string&) o Appends a new string to the end of the list • boolcontains(conststd::string&) o Returns TRUE if string is in list, else returns FALSE • intsize() o Returns the number of elements in the list (or 0 if there are none) • voiddeleteAll() o Removes all list elements, freeing all dynamically allocated memory • std::stringget(constint&) o Returns the string at the location specified o If the location referenced does not exist, throws an exception Before getting started on this project, make sure the sample compiles for you and that you can run it. (it should produce output). When you have completed your work, it will produce the following: Solution for apeend try this for searching a particular node { struct node* current = head; // Initialize current while (current != NULL) { if (current->key == x) return true; current = current->next; } return false;
  • 2. } for size of linked list for deletion returns string at specified location //this is similar to search operation struct node* current = head; // Initialize current while (current != NULL) { if (current->key == x) return true; return x->data; current = current->next; } return false; }