Differences Between Linear Search and Binary Search
What are the differences between Linear Search and Binary Search?
|1. It searches from the beginning to end.||1. It searches from the middle.|
|2. It takes more time to find if the number is at the end.||2. It takes more time even the searched item is at the beginning.|
|3. The items may be sorted.||3. The items must be sorted.|
|4. It is inefficient with large data.||4. It is more efficient than linear search.|
|5. Its big-Oh notation is O(n).||5. Its big-Oh notation is O(log(n))|