Write a program that stores integers in a linked list. Please refer the following data structure for the implementation. Your program will ask users to input an integer and then insert the integer at the front of the list. Call your application ex51.cpp. Please do not test remove yet. You will need the method for 5.2. class ListNode { public: int data; ListNode *next; }; class linkedList {

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 16PE: The implementation of a queue in an array, as given in this chapter, uses the variable count to...
icon
Related questions
Question

In C++,

 

Write a program that stores integers in a linked list. Please refer the following data structure for
the implementation. Your program will ask users to input an integer and then insert the integer at
the front of the list. Call your application ex51.cpp. Please do not test remove yet. You will need
the method for 5.2.
class ListNode {
public:
int data;
ListNode *next;
};
class linkedList{
private:
ListNode *head;
public:
};
NULL; }
data);
void remove (ListNode *prev, ListNode *curr);
void traverse();
ListNode* find(int target);
linkedList () { head
void insertFront (int
=
Transcribed Image Text:Write a program that stores integers in a linked list. Please refer the following data structure for the implementation. Your program will ask users to input an integer and then insert the integer at the front of the list. Call your application ex51.cpp. Please do not test remove yet. You will need the method for 5.2. class ListNode { public: int data; ListNode *next; }; class linkedList{ private: ListNode *head; public: }; NULL; } data); void remove (ListNode *prev, ListNode *curr); void traverse(); ListNode* find(int target); linkedList () { head void insertFront (int =
Write and test the additional methods, findAndReplace, findAndInsert, and findAndRemove. Call
your application ex52.cpp.
●
findAndReplace: Will replace an item to the target value.
findAnd Insert: Will insert an item next to the target value.
findAndRemove: Will remove an item from the list.
Transcribed Image Text:Write and test the additional methods, findAndReplace, findAndInsert, and findAndRemove. Call your application ex52.cpp. ● findAndReplace: Will replace an item to the target value. findAnd Insert: Will insert an item next to the target value. findAndRemove: Will remove an item from the list.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Concept of Threads
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT