MCPcopy Create free account
hub / github.com/Blankj/awesome-java-leetcode / compare

Method compare

src/com/blankj/hard/_0023/Solution.java:49–54  ·  view source on GitHub ↗
(ListNode o1, ListNode o2)

Source from the content-addressed store, hash-verified

47 if (lists.length == 0) return null;
48 PriorityQueue<ListNode> queue = new PriorityQueue<>(lists.length, new Comparator<ListNode>() {
49 @Override
50 public int compare(ListNode o1, ListNode o2) {
51 if (o1.val < o2.val) return -1;
52 else if (o1.val == o2.val) return 0;
53 else return 1;
54 }
55 });
56 ListNode node = new ListNode(0), tmp = node;
57 for (ListNode l : lists) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected