subject

Goals: Create your own linked list.
Perform basic linked list operations.
Requirements:
Write a program that implements and demonstrates a linked list using functions. Your program should first define a node that stores an integer and then your program will include the following functions:
append() - This function accepts the head pointer (by reference) of a linked list and an integer as it's only arguments. It then creates a node, stores the integer argument in the node, and adds it to the end of the list.
find() - This function accepts the head pointer (by value) of a linked list and an integer to search for in the list as it's only arguments. It then searches the list for the first occurrence of the integer argument. If it finds it, it returns true. If it doesn't, it returns false.
clear() -- This function accepts the head pointer of a linked list (by reference) as it's only argument. It then removes all the nodes of the linked list from memory by deleting them one at a time. The function leaves the head pointer set to nullptr.
print() - This function accepts the head pointer of a linked list (by value) as it's only argument and then displays on the screen all the integers stored in the list.
Demonstrate your functions by adding 5 numbers to the linked list. Then, print the list. Then search the list for a value and then indicate the result. Finally, print the list one last time.
The only functions that interact with the user is the print() function (and main()). No other functions contain cin or cout statements.
Use the posted algorithms on Canvas to guide you. You need merely translate them to C++. Translating the pseudocode into C++ is a major portion of the assignment! The previous labs have included sample pseudocode to prepare you for this. If you skipped the labs, well, you may be in trouble.
The sample code in the text will be of very little use. The sample code in chapter 17 is based on classes which are not covered in this course. if your solution includes classes, I will give you 0 points for your submission. I'm asking you to write functions, not classes.
Notes:
Your solution will receive major penalties for memory leaks.
This assignment is a "capstone" assignment where you will demonstrate your accumulated knowledge over the semester.
A 20-Point Sample Run:
The first line contains all the integers of my list after appending them.
The second line is the result of my find function searching for 68.
Hints:
Make sure you understand pointers and dynamic memory allocation.
Write your print() function first, it will help in testing.
Write one function at a time.
Use hand-tracing to hunt down any errors.
If your program crashes, it is almost certainly because you are dereferencing an invalid memory location which is the result of a logic error.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 00:20
The guy wire bd exerts on the telephone pole ac a force p directed along bd. knowing the p must have a 720-n component perpendicular to the pole ac, determine the magnitude of force p and its component along line ac.
Answers: 2
question
Computers and Technology, 24.06.2019 10:00
In which view can you see speaker notes?
Answers: 1
question
Computers and Technology, 25.06.2019 08:30
What is the chief concern of cloud computing?
Answers: 1
question
Computers and Technology, 25.06.2019 12:30
The term used to describe the shape and layout of a computer component such as a motherboard or hard drive is __ factor?
Answers: 1
You know the right answer?
Goals: Create your own linked list.
Perform basic linked list operations.
Requirements:...
Questions
question
Mathematics, 06.05.2020 21:57
question
Social Studies, 06.05.2020 21:57
Questions on the website: 13722367