The time complexity of linear search in the worst-case scenario is _______.

  • O(1)
  • O(log n)
  • O(n)
  • O(n^2)
The time complexity of linear search in the worst-case scenario is O(n), where 'n' is the number of elements in the array. This is because, in the worst case, the algorithm may need to traverse the entire array to find the desired element.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *