Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help to answer these questions in C language please with an explanation.I will rate you 10. Write a function that deletes every other element
Need help to answer these questions in C language please with an explanation.I will rate you
10. Write a function that deletes every other element in a linked list. (Try writing it both ways: one where it starts deleting at the head of the list, and one where it starts deleting at the element just after the head of the list.) Can you write this both iteratively and recursively? 11. Write a function that deletes all even integers from a linked list. 12. Write a function that takes a sorted linked list and an element to be inserted into that linked list, and inserts the element in sorted order. The function signature is: node *insertSorted(node *head, int n) 13. Write a function that takes the tail of a linked list and inserts a new element at the tail. Ensure that the function returns the new tail of the list. How would you have to call this function from main) in order to ensure you update your head and tail pointers correctly? (In what case(s) do we need to update the head pointer when performing tail insertion?) The function signature is: node "taillnsert(node tail, int data) 14. One of the problems with the first insertNode) function is that it requires us to call it using head- insertNode(head, i). That's a bit dangerous, because we could forget the "head -" part very easily. Re- write the function so that it takes a pointer to head, thereby allowing it to directly modify the contents of head without any need for a return value. The function signature is: void insertNode(node *"head, int data). The function will be called using insertNode(&head, i,)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started