post #11 of 11
Quote:
Originally Posted by FusionFX;12750090 
f(n) = (n²-n)/2

Yup, that's it. In big O notation you can drop the 1/2 factor as well as the -n term, making it O(n^2)
Quote:
Originally Posted by LetThereBeDwight;12750021 
Well if were talking about exact, the question is how many times the if statement is reached, not how many times it will be stepped into. So the answer is in my above post.

No ****, big surprise that somebody on the internet knows the answer to the first big-o question a CS student will see. It's better to help him come up with the answer than to plop it down in front of him
Edited by rabidgnome229 - 3/16/11 at 10:48am
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply