摘要: binary search binary search time complexity = O(logn) the question usually give you a sorted array and then find a target(index) in the value: the big 阅读全文
posted @ 2022-07-19 20:36 奋斗中的菲比 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 不是O(N^2) ,是O(N)。两个指针遍历了整个数组一次 时间复杂度与最内层循环主体的执行次数有关与有多少重循环无关. The time complexity is related to the number of executions of the innermost loop body, in 阅读全文
posted @ 2022-07-19 19:19 奋斗中的菲比 阅读(18) 评论(0) 推荐(0) 编辑