

The first line of input contains a single integer T, representing the number of test cases or queries to be run.
Then the 'T' test cases follow.
The first line of each test case contains the elements of the singly linked list separated by a single space and terminated by -1. Hence, -1 would never be a list element.
For each test case, print the sorted linked list. The elements of the sorted list should be single-space separated, terminated by -1.
The output of each test case is printed in a separate line.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 10
1 <= L <= 10 ^ 2
- 10 ^ 9 <= DATA <= 10 ^ 9 and DATA != -1
Where 'T' is the number of test cases, 'L' is the number of nodes in the linked list and 'DATA' is the value of any node in the given linked list.
Time limit: 1 sec.
We can recursively sort the linked list by using the Quick Sort algorithm.
Note: head points to the first element and tail points to the last element of the linked list.
For finding the tail, we will traverse the list until we have found a node whose ‘next’ value is NULL.
Recursive State: Node *quickSortHelper( Node *head, Node *tail ), it will return the new head after sorting the list.
Base Case: When head and tail point to the same node or head is NULL, we will return the head.