Skip to content

153. Find Minimum in Rotated Sorted Array#44

Open
skypenguins wants to merge 1 commit into
mainfrom
leetcode/arai60/problem-153
Open

153. Find Minimum in Rotated Sorted Array#44
skypenguins wants to merge 1 commit into
mainfrom
leetcode/arai60/problem-153

Conversation

@skypenguins

Copy link
Copy Markdown
Owner

153. Find Minimum in Rotated Sorted Array

次回予告: 198. House Robber

@skypenguins skypenguins self-assigned this Jul 5, 2026
Comment thread memo.md
class Solution:
def findMin(self, nums: List[int]) -> int:
return min(nums)
```

@h-masder h-masder Jul 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

丁寧に実行時間の見積もりをしたほうが良いかと思います。

CPythonを見ると、minの計算量自体はO(N)のようです(Nはnumsの長さ)
https://github.com/python/cpython/blob/main/Python/bltinmodule.c#L2087

このアプローチのポイントは、「N が十分小さいのであれば、線形探索でも要求される実行時間内で処理が完了する、もしくは、線形探索の方が二分探索などの別の手法と比べて(実装が単純で)実行時間も速い」という点だと思います。

Nの長さがどの程度まではこの手法を採用し、それを超える場合は別の手法を検討すべきなのか、という観点で考えるとよいと思います。

また、将来的に numsがどの程度の大きさまで増える可能性があるのか、想定するアプリケーションやユースケースを踏まえて考えることも重要だと思います。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants