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, 22.06.2019 06:00
Pthe price of tickets in a group when a purchased in bulk can be found with the equation c=px+24 were c is the cost, p is the number of people,and x is the price per ticket. what is price of of each ticket if it costs $189 to buy tickets for 15 people ? a $8 b $24c $9d $11 show work
Answers: 1
question
Computers and Technology, 22.06.2019 17:00
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best suited for this?
Answers: 2
question
Computers and Technology, 24.06.2019 10:00
Each time you save a document, you will need to type in the file type in which it should be saved you can select the save button to save it with the same file name if it has been previously saved you will need to select the location to save the file you will need to use the save as dialog box
Answers: 1
question
Computers and Technology, 24.06.2019 12:00
What is a sketch or blueprint of a web page that shows the structure (but not the detailed design) of basic page elements such as the logo, navigation, content, and footer?
Answers: 3
You know the right answer?
Goals: Create your own linked list.
Perform basic linked list operations.
Requirements:...
Questions
question
English, 02.12.2019 18:31
question
Mathematics, 02.12.2019 18:31
Questions on the website: 13722367