What is the time complexity of the following Python code snippet? Python def…
PYQ Deloitte Hiring Assessment 2024
What is the time complexity of the following Python code snippet?
Python
def find_element(arr, x):
for element in arr:
if element == x:
return True
return False
- A.
O(log n)
- B.
O(1)
- C.
O(n)
- D.
O(n^2)
Attempted by 313 students.
Sign up free to check your answer
Sign up freeLoading lesson…

