Given a doubly linked list and a position. The task is to delete a node from given position in a doubly linked list.
First line of input contains number of testcases. First line of each testcase contains number of elements in the linked list and next line contains the elements of the linked list. The last line contains the position from which element is to be deleted.
Delete the node from the given doubly linked list and set *head_ref if required.
The task is to complete the function deleteNode() which should delete the node at given position.
1 <= T <= 300
2 <= N <= 100
1 <= x <= N
1 3 4
1 5 2 9
5 2 9
Testcase 1: After deleting the node at position 3 (position starts from 1), the linked list will be now as 1->3.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.