Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

Strategies for Managing Conflict Conflict Outcomes?

Answered: 1 week ago

Question

=+free to pirate employees from competitors?

Answered: 1 week ago