mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-25 11:13:38 +08:00
1. Add build script for Java.
2. Add height limitation for code blocks in extra.css. 3. Fix "节点" to "结点".
This commit is contained in:
@ -19,12 +19,7 @@ comments: true
|
||||
=== "Java"
|
||||
|
||||
```java title="hashing_search.java"
|
||||
/* 哈希查找(数组) */
|
||||
int hashingSearchArray(Map<Integer, Integer> map, int target) {
|
||||
// 哈希表的 key: 目标元素,value: 索引
|
||||
// 若哈希表中无此 key ,返回 -1
|
||||
return map.getOrDefault(target, -1);
|
||||
}
|
||||
[class]{hashing_search}-[func]{hashingSearchArray}
|
||||
```
|
||||
|
||||
=== "C++"
|
||||
@ -125,12 +120,7 @@ comments: true
|
||||
=== "Java"
|
||||
|
||||
```java title="hashing_search.java"
|
||||
/* 哈希查找(链表) */
|
||||
ListNode hashingSearchLinkedList(Map<Integer, ListNode> map, int target) {
|
||||
// 哈希表的 key: 目标结点值,value: 结点对象
|
||||
// 若哈希表中无此 key ,返回 null
|
||||
return map.getOrDefault(target, null);
|
||||
}
|
||||
[class]{hashing_search}-[func]{hashingSearchLinkedList}
|
||||
```
|
||||
|
||||
=== "C++"
|
||||
|
Reference in New Issue
Block a user