Question
which of the following Determine the time and space complexities of a linear search.
Time complexity :O(log(n)) Space complexity O(n)
Time complexity :O(n) Space complexity O(log(n))
Time complexity :O(n) Space complexity O(n)
Time complexity O(log(n)) Space complexity O(log(n))
Time complexity :O(log(n)) Space complexity O(n)
Time complexity :O(n) Space complexity O(log(n))
Time complexity :O(n) Space complexity O(n)
Time complexity O(log(n)) Space complexity O(log(n))
Answers
GPT 3.5
The correct answer is:
Time complexity :O(n) Space complexity O(1)
Time complexity :O(n) Space complexity O(1)