Add C++ code for the chapter binary tree.

This commit is contained in:
Yudong Jin
2022-11-29 02:21:49 +08:00
parent 980eaf65e0
commit d2db8b8d60
14 changed files with 613 additions and 17 deletions

View File

@@ -40,7 +40,7 @@ int main() {
cout << "目标元素 3 的索引 = " << index << endl;
/* 哈希查找(链表) */
ListNode* head = vectorToLinkedList(nums);
ListNode* head = vecToLinkedList(nums);
// 初始化哈希表
unordered_map<int, ListNode*> map1;
while (head != nullptr) {

View File

@@ -42,7 +42,7 @@ int main() {
cout << "目标元素 3 的索引 = " << index << endl;
/* 在链表中执行线性查找 */
ListNode* head = vectorToLinkedList(nums);
ListNode* head = vecToLinkedList(nums);
ListNode* node = linearSearch(head, target);
cout << "目标结点值 3 的对应结点对象为 " << node << endl;