CSE-F-SLL-SWAP
Submit solution
C++, Java, Python
Points:
10
Time limit:
2000.0s
Memory limit:
12M
Problem type
Allowed languages
Implement Singly Linked-List with the following conditions.
Create a Singly Linked List with 10 values. Take two values from this SLL as input from the user and search them in the list. If both the values are found, your task is to swap both the nodes in which these values are found. Note, that you are not supposed to swap values.
Do the above swapping for all these cases.
a. None of the node is the first node and both of them are not adjacent
b. None of the node is the first node and both of them are adjacent
c. One of the nodes is the first node and both of them are not adjacent
d. One of the nodes is the first node and both of them are adjacent / that is swap first and second node
Comments