subject
Computers and Technology, 13.05.2021 18:20 2006260

For your eleventh programming assignment you will be implementing a program that uses a linked list. You will be implementing the following structure and functions:
struct LinkedList
{
int value;
LinkedList *next;
};
append_node: Appends a new node (created using the new statement) to the end of the linked list.
insert_node: Inserts a new node (created using the new statement) at the specified location in the list.
delete_node: Deletes a node from the specified location in the list search_node: searches the list for a value.
destroy_list: At the end of the program, this function loops through the entire list and destroys the list by using the delete statement on each dynamically allocated linked list node (to avoid a memory leak). Note that with a singly linked list, you need to maintain a head pointer (pointer to the beginning of the list). Typically, a tail pointer (pointer to the end of the list) is not maintained in a singly linked list (because you can only iterate from the beginning to the end), although it can be.
Enter the number of initial nodes (must be at least 1): -1
Enter the number of initial nodes (must be at least 1): -2
Enter the number of initial nodes (must be at least 1): 7
Enter a number: 0
Enter a number: 5
Enter a number: 10
Enter a number: 15
Enter a number: 20
Enter a number: 25
Enter a number: 30
Here are the initial values in the linked list:
0
5
10
15
20
25
30
Enter a number for a new node to insert to the linked list:
17 Here is the updated linked list:
0
5
10
15
17
20
25
30
Enter the number of the node that you want to delete from the linked list: 25
Here is the updated linked list:
0
5
10
15
17
20
30
Enter the number that you want to search for in the list: 20
Number found at index 5 in the linked list
Press any key to continue...

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 18:40
How does is make you feel when you're kind to others? what are some opportunities in your life to be more kind to your friends and loved ones? imagine a world where kindness has be outlawed. how would people act differently? would your day-to-day life change significantly? why or why not?
Answers: 2
question
Computers and Technology, 24.06.2019 16:30
The database design steps are listed below in the incorrect order. choose the correct order number next to each step. determine the information to be stored in the database. determine the fields needed to record the data determine if there will be any repetition of data entered, and separate the fields into tables to normalize the data. create relationships to connect the tables.
Answers: 3
question
Computers and Technology, 25.06.2019 03:30
Which task should happen during the planning stage of a project
Answers: 2
question
Computers and Technology, 25.06.2019 23:00
Which of the following is used to manage the objects in a database? a. file tab b. navigation pane c. window controls d. the ribbon
Answers: 1
You know the right answer?
For your eleventh programming assignment you will be implementing a program that uses a linked list....
Questions
question
Mathematics, 16.12.2020 02:10
question
Mathematics, 16.12.2020 02:10
question
Health, 16.12.2020 02:10
question
Mathematics, 16.12.2020 02:10
question
Mathematics, 16.12.2020 02:10
question
Social Studies, 16.12.2020 02:10
Questions on the website: 13722361