This program is to implement a number of functions on a linked list.

1.Insertion of a node to a linked list, by given criteria

2. Deletion of a node on a linked list, by given criteria

3. Search a node on a linked list, by given criteria

4. Sorting a linked list, by given criteria (extra credit)

5. Write: print out information (name and score) in each and every node on the linked list, from the first node to the last

Node structure: Use the circular doubly linked list discussed in lecture

Info Field: Name (only one string, for simplicity) Score (an integer)

Links: prev, next

1. Insertion criteria:

a. The linked list insertion is based on alphabetical order of the given names.

b. Names will not be duplicated.

2. Deletion criterion

For a given name, delete that name associated node from the linked list, if it exists.

3. Search criteria:

a. For a given name, search on the linked list if there is a node that has this name.

b. If found, print out the node info: Name and Score. One single line for each searched node.

c. If not found, print out not found.

d. The search process cannot change any info or node on the list.

4.Given a criterion, sort the linked in either ascending or descending order.

The program reads from a3.txt for actions (insertion, deletion, or search):

%SEARCH, %INSERT, %DELETE, %WRITE, %SORT, %END

The WRITE command directs the program to print out information (name and score) in each and every node on the linked list, from the first node to the last.

The SORT is to sort the list according to the scores, in ascending order.

The END command ends the program running, but not closing the window.

A code blocks project (assig3_start) is provided as a starting point to build on. The project opens the text file and reads in the instructions. This is provided as an example as to how to read in the instructions and do conversions from strings to integers. The program uses an if-then-else structure for implementing the commands. Also the project provides a possible llist (linked list) class structure to implement the linked list functions. Please feel free to use this structure or change it. There are many ways to implement these functions. Hint for implementing the sort function you can use the selection sort algorithm. You can use two pointers that are moved as the for loop indices are incremented. You need a swap function for nodes. It is easier to swap node data than pointers but this is less efficient for nodes that hold large amounts of data.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.