剑指 Offer 11. 旋转数组的最小数字 - 简单

剑指 Offer 11. 旋转数组的最小数字
二分法
- 时间复杂度
O(log n) 在二分查找的过程中,大部分情况都会忽略一半的区间。 - 空间复杂度
O(1)
1 | func minArray(_ numbers: [Int]) -> Int { |
一次遍历法
- 时间复杂度
O(n) - 空间复杂度
O(1)
1 | func minArray(_ numbers: [Int]) -> Int { |
- Post title:剑指 Offer 11. 旋转数组的最小数字 - 简单
- Post author:xxxixxxx
- Create time:2021-02-24 10:36:00
- Post link:https://xxxixxx.github.io/2021/02/24/2000-013-剑指 Offer 11. 旋转数组的最小数字/
- Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.
Comments