What is the worst-case time complexity of Linear Search?
- O(1)
- O(log n)
- O(n)
- O(n^2)
The worst-case time complexity of Linear Search is O(n), where 'n' is the number of elements in the data. In the worst scenario, the search may have to check every element in the list to find the target, making it a linear time algorithm.
Loading...
Related Quiz
- When would you prefer byte streams over character streams while performing I/O operations in Java?
- Which data type would be suitable to store a character value in Java?
- What is the primary difference between StringBuilder and StringBuffer classes in Java?
- What is the role of FileWriter and FileReader in character streams when dealing with file I/O?
- The ________ interface of the JDBC API provides cursor support, which allows forward and backward navigation through the result set.