The time complexity of checking the existence of an element in a list is _______.

  • O(1)
  • O(log n)
  • O(n)
  • O(n^2)
The time complexity of checking if an element exists in an unsorted list is O(n), where 'n' is the number of elements in the list. It requires searching through the list linearly to find the element.
Add your answer
Loading...

Leave a comment

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