Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Given the input and output, why isn't a linear search a proper solution?


Because linear is O(n) and binary is O(log(n))?


Oh, sorry - didn't notice that was a requirement.


I don't think it was an explicit requirement, it just would be very wasteful to do a linear search on a sorted list.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: