Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yennanliu committed Mar 15, 2024
1 parent 0a7b5cc commit 3cd3f63
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/cheatsheet/java_trick.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

- Define max-heap
- LC 1046
```java
```java
// java
PriorityQueue<Integer> heap = new PriorityQueue<>(Comperator.reverseOrder());
```
Expand Down
22 changes: 19 additions & 3 deletions leetcode_java/src/main/java/dev/Test2.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import LeetCodeJava.DataStructure.TreeNode;

import java.util.*;

public class Test2 {
public static void main(String[] args) {
Expand Down Expand Up @@ -34,6 +34,22 @@ public static void main(String[] args) {
System.out.println(new int[]{1,2,3});

List<Integer> x2 = new ArrayList<>(Arrays.asList(1, 2, 3));


// PriorityQueue for PriorityQueue
PriorityQueue<Integer> pq = new PriorityQueue<>();
pq.add(1);

// LinkedList for Queue
Queue<Integer> q = new LinkedList<>();
q.add(1);


String str = "abcd";

System.out.println(str);
System.out.println(str.indexOf(1));

}

}

0 comments on commit 3cd3f63

Please sign in to comment.