@@ -0,0 +1,1219 @@
+package linkedlist;%0A%0Aimport java.util.Comparator;%0Aimport java.util.List;%0Aimport java.util.PriorityQueue;%0Aimport java.util.Queue;%0A%0A/**%0A * Created by wuwenjie on 2/19/16.%0A */%0Apublic class MergeKSortedLists1 %7B%0A%0A    private class ListNodeComparator implements Comparator%3CListNode%3E %7B%0A        public int compare(ListNode n1, ListNode n2) %7B%0A            return n1.val - n2.val;%0A        %7D%0A    %7D%0A%0A    /**%0A     * @param lists: a list of ListNode%0A     * @return: The head of one sorted list.%0A     */%0A    public ListNode mergeKLists(List%3CListNode%3E lists) %7B%0A        if (lists == null %7C%7C lists.size() == 0) %7B%0A            return null;%0A        %7D%0A%0A        Queue%3CListNode%3E queue = new PriorityQueue%3CListNode%3E(lists.size(), new ListNodeComparator());%0A%0A        for (ListNode node : lists) %7B%0A            if (node != null) %7B%0A                queue.offer(node);%0A            %7D%0A        %7D%0A%0A        ListNode dummy = new ListNode(0);%0A        ListNode current = dummy;%0A%0A        while (queue.peek() != null) %7B%0A            ListNode node = queue.poll();%0A            if (node.next != null) %7B%0A                queue.offer(node.next);%0A            %7D%0A            current.next = node;%0A            current = node;%0A        %7D%0A%0A        return dummy.next;%0A    %7D%0A%0A%7D%0A

add Merge K Sorted List, standard heap solution