We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa9fa72 commit cb26369Copy full SHA for cb26369
java/23-Merge-k-Sorted-Lists.java
@@ -2,7 +2,7 @@
2
// Time Complexity: O(n*log(k))
3
// Extra Space Complexity: O(n)
4
5
-class Solution {
+class Solution1 {
6
public ListNode mergeKLists(ListNode[] lists) {
7
8
Queue<Integer> minHeap = new PriorityQueue<>();
@@ -31,7 +31,7 @@ public ListNode mergeKLists(ListNode[] lists) {
31
32
// Extra Space Complexity: O(1)
33
34
+class Solution2 {
35
36
int size = lists.length;
37
int interval = 1;
0 commit comments