Sort the given doubly linked list using quicksort. Just complete the partition function using quicksort technique try to solve it in O(1) space.
In this problem, method takes two argument: the node1 and node2. The function should not read any input from stdin/console.
The struct Node has a data part which stores the data and a next pointer which points to the next element of the linked list.
There are multiple test cases. For each test case, this method will be called individually.
Return p from function.
The task is to complete the function
1 <= T <= 100
1 <= N <= 200
4 2 9
1 4 9 2
2 4 9
1 2 4 9
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.