mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-16 03:59:18 +08:00
refactor: Replace 结点 with 节点 (#452)
* Replace 结点 with 节点 Update the footnotes in the figures * Update mindmap * Reduce the size of the mindmap.png
This commit is contained in:
@@ -17,7 +17,7 @@ int hashingSearchArray(unordered_map<int, int> map, int target) {
|
||||
|
||||
/* 哈希查找(链表) */
|
||||
ListNode* hashingSearchLinkedList(unordered_map<int, ListNode*> map, int target) {
|
||||
// 哈希表的 key: 目标结点值,value: 结点对象
|
||||
// 哈希表的 key: 目标节点值,value: 节点对象
|
||||
// 若哈希表中无此 key ,返回 nullptr
|
||||
if (map.find(target) == map.end())
|
||||
return nullptr;
|
||||
@@ -44,11 +44,11 @@ int main() {
|
||||
// 初始化哈希表
|
||||
unordered_map<int, ListNode*> map1;
|
||||
while (head != nullptr) {
|
||||
map1[head->val] = head; // key: 结点值,value: 结点
|
||||
map1[head->val] = head; // key: 节点值,value: 节点
|
||||
head = head->next;
|
||||
}
|
||||
ListNode* node = hashingSearchLinkedList(map1, target);
|
||||
cout << "目标结点值 3 的对应结点对象为 " << node << endl;
|
||||
cout << "目标节点值 3 的对应节点对象为 " << node << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user