edited by
889 views

2 Answers

2 votes
2 votes
consider the input size of an algorithm is 'n'. As the space taken by the algorithm is 'n' the time taken wil be vary based on the algorithm such as O(n),O(n^2),O(n^3) etc.But the input size is always n.

Therefore consider S(n) as space complexity i.e is s(n) =n and the time complexity as T(n)=n or n^2 or n^3 etc.

so S(n)<=C.T(n)

Therefore S(n)=O(T(n)).
0 votes
0 votes
I don't think anything can be said about the relation between space and time complexity in here. The space complexity is going to be big omega(n).

If the algo of binary search then t(n)= O(log n). And if the algo is of selection sort t(n) = O(n^2).
edited by

Related questions

0 votes
0 votes
3 answers
1
Subham Nagar asked Mar 20, 2018
1,261 views
An array $'A'$ has $n$ distinct integers. What is the tightest time complexity to check $A[i]=i$ for some $i$. Consider all elements of array within range from $1$ to $n$...
0 votes
0 votes
0 answers
2
Kai asked Jan 29, 2017
448 views
Time complexity of the given program is?
1 votes
1 votes
1 answer
3
2 votes
2 votes
1 answer
4