1.
Under which of these conditions will a sequential search be faster than a binary search?
- The value you are searching for is the first element in the array.
- Only when the search value is the first item in the array, and thus the first value encountered in sequential search, will sequential be faster than binary.
- The value you are searching for is the last element in the array
- In this case a sequential search will have to check every element before finding the correct one, whereas a binary search will not.
- The value you are searching for is in the middle of the array.
- Results will differ depending on the exact location of the element, but Binary Search will still find the element faster while Sequential will have to check more elements.
- The value you are searching for is not in the array
- If the search value is not in the array, a sequential search will have to check every item in the array before failing, a binary search will be faster.
- Sequential Search can never be faster than Binary Search.
- When the search value is the first element, Sequential will always be faster, as it will only need to check one element.