![]() |
| ||
| A couple of ?s on algorithms. Help Plz Trying to understand how to do this Q. Can some explain using O-notation, how would i analyse the efficiency of the two algorithms below. ? Assuming that the critical operation is compute and size is the size of the array. 1) compute(a[1]) + compute(a[2]) + compute(a[3]) + compute(a[size]) 2) for k = 1 to size for j = 1 to size compute(a[j]) I just need someone to xplain this briefly so that i can understand how i would analyze algorithms of such in the future. Also what is meant by the terms 'Programming Time' and 'Execution Time' in relation to algorithms.? Apreciate ne help |
| ||
| Re: A couple of ?s on algorithms. Help Plz Quote:
how long time it takes for the algorithm to execute. For example, if testing a sort algorithm, how long does it take the alogithm to sort the data. That is normally measured by getting current system time before starting the algorithm, again after and subtacting the two. clock_t t1 = clock(); // get start time |
| ||
| Re: A couple of ?s on algorithms. Help Plz thanx bro. |
| All times are GMT -4. The time now is 11:40 pm. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC