Y
Hacker News
new
|
ask
|
show
|
jobs
by
swah
5558 days ago
Given the input and output, why isn't a linear search a proper solution?
1 comments
ppod
5557 days ago
Because linear is O(n) and binary is O(log(n))?
link
swah
5554 days ago
Oh, sorry - didn't notice that was a requirement.
link
ppod
5549 days ago
I don't think it was an explicit requirement, it just would be very wasteful to do a linear search on a sorted list.
link