DoublyLinkedList_Myfscetionm


Submit solution

Points: 20
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
Python

Implement Doubly Linked List.

Input:

The First line of the input contains an integer N denoting the number of test cases.
The Second line of the input contains an integer N denoting the number of operations
Then for each input line of operation has the following format:

P                         Prepend(insert) the data into the DLL at position 0
I         Insert the data into DLL at the given position 
A                         Append the data at tail into the DLL 
S                                       Number of elements in DLL
V                         Delete all the  nodes in DLL with the given data
D                 Delete the node in the gievn position
###Constraints 1 <= N <= 20 ###Sample Input:
1
13
P 1
I 1 2
S
I 3 3
S
V 4
S
D 1
S
D 5
S
V 0
S
Sample Output:
1
1 2
2
1 2 3
3
Element Not Found
1 2 3
3
1 3
2
1
1
Element Not Found
1
1

Comments

There are no comments at the moment.