<commit_before>/**
 * Definition for singly-linked list.
 * public class ListNode {
 *     int val;
 *     ListNode next;
 *     ListNode(int x) {
 *         val = x;
 *         next = null;
 *     }
 * }
 */
public class Solution {
    public ListNode insertionSortList(ListNode head) {
        ListNode dummy = new ListNode(-2147483648);
        dummy.next = head;
        ListNode p = dummy;
        while ((p != null) && (p.next != null)) {
            if (p.next.val >= p.val) {
                p = p.next;
            } else {
                ListNode tmp = dummy;
                while (tmp.next.val < p.next.val) {
                    tmp = tmp.next;
                }
                ListNode new_tmp = p.next;
                p.next = p.next.next;
                new_tmp.next = tmp.next;
                tmp.next = new_tmp;
            }
        }
        return dummy.next;
    }
}<commit_msg>InsertionSortList<commit_after>/**
 * Definition for singly-linked list.
 * public class ListNode {
 *     int val;
 *     ListNode next;
 *     ListNode(int x) { val = x; }
 * }
 */
public class Solution {
    public ListNode insertionSortList(ListNode head) {
        if (head == null || head.next == null) {
            return head;
        }
        
        ListNode dummy = new ListNode(Integer.MIN_VALUE);
        dummy.next = head;
        ListNode sorted = head;
        while (sorted.next != null) {
            if (sorted.next.val >= sorted.val) {
                sorted = sorted.next;
            } else {
                ListNode p = dummy;
                while (p.next.val < sorted.next.val) {
                    p = p.next;
                }
                
                ListNode tmp = sorted.next;
                sorted.next = sorted.next.next;
                tmp.next = p.next;
                p.next = tmp;
            }
        }
        
        return dummy.next;
    }
}
{'fraction_non_alphanumeric': 0.11181102362204724, 'fraction_numerical': 0.005249343832020997, 'mean_word_length': 1.195852534562212, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4410994', 'n_tokens_mistral': 571, 'n_tokens_neox': 546, 'n_words': 131}