•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 383,414 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,741 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser:
Views: 826 | Replies: 2
![]() |
•
•
Join Date: Mar 2005
Posts: 73
Reputation:
Rep Power: 4
Solved Threads: 0
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
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
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,346
Reputation:
Rep Power: 34
Solved Threads: 839
•
•
•
•
Originally Posted by nabil1983
Also what is meant by the terms 'Programming Time' and 'Execution Time' in relation to algorithms.?
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 // do algorithm clock_t t2 = clock();// get end time clock_t delta_time = t2 - t1; // difference
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
- plz help me plz plz plz plz plz plz (C)
- Sorting in Python (Python)
- hotoffers popup/homepage plz help (Viruses, Spyware and other Nasties)
- Page Cannot Be Displayed/... PLZ HELP? (Windows NT / 2000 / XP / 2003)
Other Threads in the C Forum
- Previous Thread: Problem with precedence in C
- Next Thread: String Array



Linear Mode