File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Chp. 02 - Linked Lists/_2_7_Intersection
Chp. 17 - More Problems (Hard)/_17_20_Continuous_Median Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 10
10
11
11
public class Intersection {
12
12
public static Integer findMergeNode (Node headA , Node headB ) {
13
+ if (headA == null || headB == null ) {
14
+ return null ;
15
+ }
13
16
Node currA = headA ;
14
17
Node currB = headB ;
15
18
Original file line number Diff line number Diff line change 10
10
11
11
public class ContinuousMedian {
12
12
private static PriorityQueue <Integer > maxHeap = new PriorityQueue <>(Collections .reverseOrder ()); // maxHeap contains all SMALL elements
13
- private static PriorityQueue <Integer > minHeap = new PriorityQueue <>(); // minHeap contains all LARGE elements
13
+ private static PriorityQueue <Integer > minHeap = new PriorityQueue <>(); // minHeap contains all LARGE elements
14
14
15
15
public static void addNum (int n ) {
16
16
if (maxHeap .isEmpty ()) {
You can’t perform that action at this time.
0 commit comments