edited by
1,699 views

2 Answers

2 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 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
Position:
Show:

Related questions

0 0 votes
3 3 answers
3.2k
3.2k views
Subham Nagar asked Mar 20, 2018
3,183 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 0 votes
0 0 answers
742
742 views
Kai asked Jan 29, 2017
742 views
Time complexity of the given program is?
1 1 vote
1 answers 1 answer
1.5k
1.5k views
2 2 votes
1 answers 1 answer
1.9k
1.9k views
Tushar Shinde asked Jan 24, 2016
1,874 views
Which of the following statement is true?Binary insertion sorting (insertion sort that uses binary search to find each insertion point) requires $O (n \log n)$ total oper...