edited by
513 views
0 votes
0 votes

https://gateoverflow.in/1036/gate2004-39

WHAT IS DIFFERENCE BETWEEN TYM COMPLEXITY AND PROGRAM EXECUTION TIME??

edited by

1 Answer

0 votes
0 votes
Execution time is the total time for which program used the CPU.

Time complexity on other hand gives us an idea of with what scale execution time will increase on increasing the input.

Suppose Algo 1 is having a Time complexity of O(1), and it takes 4s as execution time when the input is given is of length 100. This means even if the input given is of length 1000, it'll still take 4s.

similarly, if Algo 2 is of O(n) and takes 4s for input of length 100, on an input of 200, it'll take around 8s. time will linearly increase for this.

Related questions

0 votes
0 votes
3 answers
1
Nisha Bharti asked Sep 26, 2022
681 views
What is the time & space complexity of this algorithm?Main(){ for(i=n; i>10; i=i^1/4) { for(j=201; j<n^3; j=j+400) ...
0 votes
0 votes
1 answer
2
tusharb asked Feb 18, 2022
658 views
As we know the time complexity of solving the greedy knapsack algorithm depends mainly on the sorting algorithm used, Can we use counting sort as the sorting algorithm to...
1 votes
1 votes
1 answer
3
sumitr asked Apr 10, 2019
1,263 views
What is the best case and worst case of the algorithm? And when will best case and worst case will happen??int main() { for(i=1 ; i<=n ; i++) { if(n%i == 0) { for(j=1 ; j...
0 votes
0 votes
1 answer
4
eyeamgj asked Oct 16, 2018
132 views
https://gateoverflow.in/154097/find-the-value-of-p AND THE TIME COMPLEXITY WILL BE O(nlogn)??