Click here to Skip to main content
15,887,485 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Algorithm Pin
Stephen Hewitt14-Aug-08 21:54
Stephen Hewitt14-Aug-08 21:54 
GeneralRe: Algorithm Pin
SatyaVas15-Aug-08 3:04
SatyaVas15-Aug-08 3:04 
Questionazimuth formula Pin
winburn12-Aug-08 21:39
winburn12-Aug-08 21:39 
AnswerRe: azimuth formula Pin
lar3ry13-Aug-08 6:16
lar3ry13-Aug-08 6:16 
QuestionBig Oh Computation Pin
Ian Uy12-Aug-08 6:49
Ian Uy12-Aug-08 6:49 
AnswerRe: Big Oh Computation Pin
Jason Lepack (LeppyR64)12-Aug-08 8:17
Jason Lepack (LeppyR64)12-Aug-08 8:17 
GeneralRe: Big Oh Computation Pin
Ian Uy12-Aug-08 8:31
Ian Uy12-Aug-08 8:31 
GeneralRe: Big Oh Computation Pin
Jason Lepack (LeppyR64)12-Aug-08 8:35
Jason Lepack (LeppyR64)12-Aug-08 8:35 
How many times do we count to n?
Hint: it's not 3 Wink | ;)

main()
{
	int count = 0;
	for(int i=0;i<n;i++)>
	{
		for(int j=0;j<n;j++)>
		{
			for(int k=0;k<n;k++)>
			{
				count++;
			}
		}
	}
}


If this were a complexity of O(n) then count would be 3n. However it's not, what's the value of count at the end?

I'm not downing you, I'm just trying to help you come to the conclusion yourself.
GeneralRe: Big Oh Computation Pin
Ian Uy12-Aug-08 8:40
Ian Uy12-Aug-08 8:40 
GeneralRe: Big Oh Computation Pin
Jason Lepack (LeppyR64)12-Aug-08 8:42
Jason Lepack (LeppyR64)12-Aug-08 8:42 
GeneralRe: Big Oh Computation Pin
Ian Uy12-Aug-08 8:52
Ian Uy12-Aug-08 8:52 
GeneralRe: Big Oh Computation Pin
Jason Lepack (LeppyR64)12-Aug-08 8:55
Jason Lepack (LeppyR64)12-Aug-08 8:55 
GeneralRe: Big Oh Computation Pin
Ian Uy12-Aug-08 8:57
Ian Uy12-Aug-08 8:57 
GeneralRe: Big Oh Computation Pin
Jason Lepack (LeppyR64)12-Aug-08 9:01
Jason Lepack (LeppyR64)12-Aug-08 9:01 
GeneralRe: Big Oh Computation Pin
supercat912-Aug-08 10:06
supercat912-Aug-08 10:06 
GeneralRe: Big Oh Computation Pin
Ian Uy12-Aug-08 16:24
Ian Uy12-Aug-08 16:24 
GeneralRe: Big Oh Computation Pin
Mark Churchill12-Aug-08 20:35
Mark Churchill12-Aug-08 20:35 
GeneralRe: Big Oh Computation Pin
Ian Uy13-Aug-08 2:49
Ian Uy13-Aug-08 2:49 
AnswerRe: Big Oh Computation Pin
Ian Uy15-Aug-08 6:56
Ian Uy15-Aug-08 6:56 
GeneralRe: Big Oh Computation Pin
Member 419459316-Aug-08 3:20
Member 419459316-Aug-08 3:20 
GeneralRe: Big Oh Computation Pin
Mark Churchill17-Aug-08 15:18
Mark Churchill17-Aug-08 15:18 
GeneralRe: Big Oh Computation Pin
Ian Uy17-Aug-08 19:29
Ian Uy17-Aug-08 19:29 
GeneralRe: Big Oh Computation Pin
Mark Churchill17-Aug-08 19:33
Mark Churchill17-Aug-08 19:33 
AnswerRe: Big Oh Computation Pin
sableng22-Aug-08 10:04
sableng22-Aug-08 10:04 
Questionde-Compress algorith Pin
Howard Richards11-Aug-08 22:57
Howard Richards11-Aug-08 22:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.