I don't get how this is Log (n), is this just an exercise to use the binary search, how does traversing using binary search make it better than traversing one by one O(n)?
Worse case it O(n) in both, average case is probably O(n/2)??
yea, that makes sense, but we don't know if this list is sorted or not.
I guess binary search only helps when all are sorted except one?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.