Can you sort a linked list java?

Problem Statement:

Sort the given singly linked list in ascending order. You have to do it in-place [using only constant extra space].

Input Format:

There is only one argument named head, denoting the head of the given singly linked list.

Output Format:

After sorting, return the head of the same linked list that is provided in the input.

Constraints: