Question: Problem 5 : removeNodes ( lst , i , n ) Starting from the ith node in a ( possibly empty ) linked list, remove
Problem : removeNodeslst i n
Starting from the ith node in a possibly empty linked list, remove the next n nodes, not including the
ith node.
We say the head of the input list is the first node, ie i
When i your function should start by removing the head.
Note:
n
i
i n lstlength
Example: let lst be a linked list
When i and n return the linked list
Explanation: The second node i is Removing the next three nodes n means removing
nodes and The remaining ones are
When i and n return the linked list
Explanation: Since i we remove the first three nodes n from the beginning of lst which
are The remaining ones are
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
