Click here to Skip to main content
11,478,174 members (73,266 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
suppose module A requires M unit of time be executed , where M is constant .
find the complexit C(n) of the following algorthim , where is size of the input data
The Algorthim :
1- Repeat for I=1 to N
2- Repeat for j=1 to N
3- Repeat for k=1 to N
4- module A
[End step 3 loop]
[End step 2 loop]
[End step 1 loop]
5- exit
(observe that algorthm use N for n)
Posted 29-Dec-12 10:23am
Comments
jibesh at 29-Dec-12 16:31pm
   
so what's the question here? what are you upto with the coding? where you stuck? Please note that we dont work for you.
nv3 at 30-Dec-12 6:07am
   
The answer to this question is so simple that it would be really embarassing to give it away. You haven't even taken to time to get the spelling of the question title right, but expect others to help you.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Sorry, we don't solve you school problems for you. By not solving them by yourself, you loose to much. The school and your assignments give you a chance to learn something. Use this chance well.

—SA
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hint: count how many times line 4 is executed.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 184
1 OriginalGriff 160
2 Frankie-C 160
3 Sascha Lefèvre 145
4 F-ES Sitecore 120
0 Sergey Alexandrovich Kryukov 7,675
1 OriginalGriff 7,256
2 Sascha Lefèvre 3,034
3 Maciej Los 2,491
4 Richard Deeming 2,305


Advertise | Privacy | Mobile
Web02 | 2.8.150520.1 | Last Updated 1 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100