Write a program list that maintains and manipulates a linked list of integers according to instructions provided in a file. list takes a single argument, which is the path to a file containing the instructions. If the file does not exist, your program must print “error” and nothing else.
list maintains a linked list containing zero or more integers, ordered from least to greatest. list will need to allocate space for new nodes as they are created using malloc; any allocated space should be deallocated using free before list terminates.
It supports two operations on this list: insert n Adds an integer n to the list. If n is already present in the list, it does nothing. The instruction
format is an i followed by a space and an integer n. delete n Removes an integer n from the list. If n is not present in the list, it does nothing. The instruction
format is a d followed by a space and an integer n.
Input format Each line of the input file contains an instruction. Each line begins with a letter (either “i” or “d”), followed by a space, and then an integer. A line beginning with “i” indicates that the integer should be inserted into the list. A line beginning with “d” indicates that the integer should be deleted from the list.
Output format Normal output for list is written on two lines. The first line is an integer indicating the length of the linked list after all instructions are performed. The second line is zero or more integers separated by spaces indicating the content of the linked list.
If the file given on the command line does not exist, list should print error and nothing else.
 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code “Newclient” for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

The post write-a-c-program-about-linkedlist appeared first on Essay Fount.


What Students Are Saying About Us

.......... Customer ID: 12*** | Rating: ⭐⭐⭐⭐⭐
"Honestly, I was afraid to send my paper to you, but you proved you are a trustworthy service. My essay was done in less than a day, and I received a brilliant piece. I didn’t even believe it was my essay at first 🙂 Great job, thank you!"

.......... Customer ID: 11***| Rating: ⭐⭐⭐⭐⭐
"This company is the best there is. They saved me so many times, I cannot even keep count. Now I recommend it to all my friends, and none of them have complained about it. The writers here are excellent."


"Order a custom Paper on Similar Assignment at essayfount.com! No Plagiarism! Enjoy 20% Discount!"