Write a program in C to manipulate linked lists. The input to the program will be a sequence of instructions of the following three categories:
The list should always be maintained in sorted order in increasing order of age. If there is more than one person of same age, the order should be as in the input. You may assume that the input is valid and correct. While executing remove or print, if the list does not have enough elements, the command should be
ignored.
You may assume that the name is always a single word with no spaces within. The age will be a positive integer. Terminate each line output with a newline character.
- insert name age: create a node with item as the info field and insert into the current list.
- remove N : remove the Nth item from the list.
- print N : print the Nth item from the list. The name should be printed first and then the age with a space in between.
- stop : end of instructions
The list should always be maintained in sorted order in increasing order of age. If there is more than one person of same age, the order should be as in the input. You may assume that the input is valid and correct. While executing remove or print, if the list does not have enough elements, the command should be
ignored.
You may assume that the name is always a single word with no spaces within. The age will be a positive integer. Terminate each line output with a newline character.