re: Linear and Binary Search in JavaScript VIEW POST

VIEW PARENT COMMENT VIEW FULL DISCUSSION
 

That's true, it depends on your data set. Assuming it's sorted and you're only worried about the run time of the search, a linear search is O(n) while a binary search is O(log n).

code of conduct - report abuse