Question 8 (Advanced):
What is the time complexity of checking if an element exists in a Python
A) O(1)
B) O(n)
C) O(log n)
D) O(n^2)
#Python #DataStructures #TimeComplexity #Advanced
✅ By: https://t.me/DataScienceQ
What is the time complexity of checking if an element exists in a Python
set
?A) O(1)
B) O(n)
C) O(log n)
D) O(n^2)
#Python #DataStructures #TimeComplexity #Advanced
✅ By: https://t.me/DataScienceQ
❤1
Question 27 (Intermediate - List Operations):
What is the time complexity of the
A) O(1) - Constant time (like appending)
B) O(n) - Linear time (shifts all elements)
C) O(log n) - Logarithmic time (binary search)
D) O(n²) - Quadratic time (worst-case)
#Python #DataStructures #TimeComplexity #Lists
✅ By: https://t.me/DataScienceQ
What is the time complexity of the
list.insert(0, item)
operation in Python, and why? A) O(1) - Constant time (like appending)
B) O(n) - Linear time (shifts all elements)
C) O(log n) - Logarithmic time (binary search)
D) O(n²) - Quadratic time (worst-case)
#Python #DataStructures #TimeComplexity #Lists
✅ By: https://t.me/DataScienceQ