Question: Write an algorithm in pseudo code to insert one element in a singly linked list before a given element. Your algorithm will print the original

Write an algorithm in pseudo code to insert one element in a singly linked list before a given element. Your algorithm will print the original list, request the user to put in an element to be inserted, and an element to indicate the location of the insertion, then print the final list after the insertion is done. If the element doesn't exist in the list, add the new element to the end of the list. (5 points) 4. Use the following as your test cases to evaluate whether your algorithm works correctly: if you have a linked list: 3->1->0, with user input 5 and 1, your list should become 3->5->1>0; with user input 5 and -1, your list should become 3->10->5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
