Format the Java codes with the Reat Hat extension.

This commit is contained in:
krahets
2023-04-14 00:12:10 +08:00
parent 7273ee24e8
commit f8513455b5
39 changed files with 195 additions and 205 deletions

View File

@ -32,7 +32,7 @@ public class hashing_search {
// 初始化哈希表
Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
map.put(nums[i], i); // key: 元素value: 索引
map.put(nums[i], i); // key: 元素value: 索引
}
int index = hashingSearchArray(map, target);
System.out.println("目标元素 3 的索引 = " + index);
@ -42,7 +42,7 @@ public class hashing_search {
// 初始化哈希表
Map<Integer, ListNode> map1 = new HashMap<>();
while (head != null) {
map1.put(head.val, head); // key: 节点值value: 节点
map1.put(head.val, head); // key: 节点值value: 节点
head = head.next;
}
ListNode node = hashingSearchLinkedList(map1, target);