标签:lse UNC 实现 middle int class ddl else def
lst = [11,22,33,44,55,66,77,88,99] def func(left,right,n): middle = (left + right) // 2 if left > right: return - 1 elif n > lst[middle]: left = middle + 1 elif n < lst[middle]: right = middle - 1 else: return print(‘cunzai‘,middle) return func(left,right,n) func(0,len(lst) - 1,66) # 递归的方式实现二分查找
标签:lse UNC 实现 middle int class ddl else def
原文地址:https://www.cnblogs.com/tengx/p/11745874.html