// linear search on array of size nWhat is the worst-case time complexity?
- A
O(n^2)
- B
O(log n)
- Ccheck_circle
O(n)
- D
O(1)
Explanation
Linear search may inspect every element, giving O(n) worst case.
AP Computer Science A· difficulty 2/5
// linear search on array of size nWhat is the worst-case time complexity?
O(n^2)
O(log n)
O(n)
O(1)
Explanation
Linear search may inspect every element, giving O(n) worst case.
Want 10 more like this — adaptive to your weak spots?