7. What is the best and worst case time complexities of linear search?
Answers
Answered by
0
Explanation:
Class
Search algorithm
Worst-case performance
O(n)
Best-case performance
O(1)
Average performance
O(n)
Worst-case space complexity
O(1) iterative
Answered by
0
Answer: Class Search algorithm
- Worst-case performance O(n)
- Best-case performance O(1)
- Average performance O(n)
- Worst-case space complexity O(1) iterative
Explanation:Although ordered linear search is better than unordered when the element is not present in the array, the best and worst cases still remain the same, with the key element being found at first position or at last position
Similar questions