Determine the time and space complexities of a linear search.(1 point) Responses time complexity: O(n) space complexity: O(log(n)) time complexity: upper O left parenthesis n right parenthesis space complexity: upper O left parenthesis log left parenthesis n right parenthesis right parenthesis time complexity: O(log(n)) space complexity: O(n) time complexity: upper O left parenthesis log left parenthesis n right parenthesis right parenthesis space complexity: upper O left parenthesis n right parenthesis time complexity: O(log(n)) space complexity: O(log(n)) time complexity: upper O left parenthesis log left parenthesis n right parenthesis right parenthesis space complexity: upper O left parenthesis log left parenthesis n right parenthesis right parenthesis time complexity: O(n) space complexity: O(n)

The correct answer is:

- Time complexity: O(n)
- Space complexity: O(1)

The correct time complexity of a linear search is O(n), and the correct space complexity is O(1).

The correct time and space complexities for a linear search are:

Time complexity: O(n)
Space complexity: O(1)

Explanation:
- Time complexity: In a linear search, the worst-case scenario occurs when the element being searched for is at the end of the list or when it is not present at all. In this case, the algorithm needs to compare the target element with every element in the list until it either finds a match or reaches the end of the list. This requires iterating through all 'n' elements in the list, resulting in a time complexity of O(n), where 'n' is the size of the list.

- Space complexity: In a linear search, no additional space is required beyond storing the input list and a few variables for tracking the search progress. These additional variables are constant in terms of the input size, so the space complexity is O(1), which means it uses a constant amount of space.