private ListNode insert(ListNode head, ListNode node) {
            if (head == null) {
                head = node;
            } else {
                if (head.val < node.val) {
                    // recursive solution
                    // head.next = insert(head.next, node);

                    ListNode pre = head;
                    while (pre.next != null && pre.next.val < node.val) {
                        pre = pre.next;
                    }
                    node.next = pre.next;
                    pre.next = node;
                } else {
                    node.next = head;
                    head = node;
                }
            }
            return head;
        }