标签:htm this log any require div ini http screen
If you were given a list of n integers and knew that they were sorted, how quickly could you check if a given integer was in the list? Elaborate on your reasoning and search methods in general
Try explaining your solution to someone and see if it makes sense ot them. Don‘t code anything for this problem
Hopefully this problem sounds familiar! We can use a binary search to search for an intger since the list is already sorted! This means we can find the item in O(logn) time and O(1) space!
Revisit the lectures on Binary Search and its implementation to fully get the reasoning behind this solution and problem!
Check time of different search methods
标签:htm this log any require div ini http screen
原文地址:http://www.cnblogs.com/prmlab/p/6961060.html