File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -679,6 +679,23 @@ Arrays.sort(map.keySet().toArray());
679679Arrays . sort(tmp, (x, y) - > Integer . compare(- x[1 ], - y[1 ]));
680680```
681681
682+ - ` floorEntry ` method in ` TreeMap `
683+ - https://blog.csdn.net/a1510841693/article/details/124323418
684+ - floorEntry() : It returns a key-value mapping associated with the greatest key less than or equal to the given key, or null if there is no such key.
685+
686+ ``` java
687+ // floorEntry
688+ // LC 1146
689+
690+ // ...
691+ TreeMap<Integer , Integer > [] historyRecords;
692+ // ...
693+ public int get(int index, int snapId) {
694+ return historyRecords[index]. floorEntry(snapId). getValue();
695+ }
696+ // ...
697+ ```
698+
682699### 1-10) Get max val from an Array
683700``` java
684701// java
You can’t perform that action at this time.
0 commit comments