Question: Write a function that deletes the n th element from a linked list. If the linked list doesn't even have n nodes, don't delete any
Write a function that deletes the nth element from a linked list. If the linked list doesn't even have n nodes, don't delete any of them. The function signature is: node *deleteNth(node *head, int n). Try implementing the function iteratively and recursively. (In terms of how to interpret n, you can start counting your nodes from zero or one; your choice.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
