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 1010
1111public class Intersection {
1212 public static Integer findMergeNode (Node headA , Node headB ) {
13+ if (headA == null || headB == null ) {
14+ return null ;
15+ }
1316 Node currA = headA ;
1417 Node currB = headB ;
1518
Original file line number Diff line number Diff line change 1010
1111public class ContinuousMedian {
1212 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
1414
1515 public static void addNum (int n ) {
1616 if (maxHeap .isEmpty ()) {
You can’t perform that action at this time.
0 commit comments