mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-07 15:01:58 +08:00
feat: Add pythontutor blocks to the rest of the chapters (#1030)
* Fix Python code * Add the pythontutor blocks of the chapter tree, heap, graph, searching, sorting, divide and conquer, dynamic programming and greedy. Improve the pythontutor blocks of the chapter array and linkedlist and backtracking. Add the tutorial of pythontutor in how-to-read section. * Reduce the image's file size.
This commit is contained in:
@ -44,9 +44,9 @@ if __name__ == "__main__":
|
||||
nums = [1, 3, 6, 8, 12, 15, 23, 26, 31, 35]
|
||||
|
||||
# 二分查找(双闭区间)
|
||||
index: int = binary_search(nums, target)
|
||||
index = binary_search(nums, target)
|
||||
print("目标元素 6 的索引 = ", index)
|
||||
|
||||
# 二分查找(左闭右开区间)
|
||||
index: int = binary_search_lcro(nums, target)
|
||||
index = binary_search_lcro(nums, target)
|
||||
print("目标元素 6 的索引 = ", index)
|
||||
|
Reference in New Issue
Block a user