Merge branch 'master' into heap-dev

This commit is contained in:
Yudong Jin
2023-01-12 04:11:22 +08:00
committed by GitHub
118 changed files with 3386 additions and 1014 deletions

View File

@ -29,9 +29,9 @@ public class linked_list {
/* 访问链表中索引为 index 的结点 */
static ListNode access(ListNode head, int index) {
for (int i = 0; i < index; i++) {
head = head.next;
if (head == null)
return null;
head = head.next;
}
return head;
}

View File

@ -131,7 +131,7 @@ public class binary_search_tree {
PrintUtil.printTree(bst.getRoot());
/* 查找结点 */
TreeNode node = bst.search(5);
TreeNode node = bst.search(7);
System.out.println("\n查找到的结点对象为 " + node + ",结点值 = " + node.val);
/* 插入结点 */