Results 1 to 3 of 3
Thread: Big-oh expression help!
- 01-24-2011, 04:36 AM #1
Member
- Join Date
- Jan 2011
- Posts
- 1
- Rep Power
- 0
Big-oh expression help!
I have two questions about big-oh expression.
The first one is:
for(i=1;i<n;++i)
for(j=1;j<floor(i/2);j++)
{
...statements that require exactly j operations...
};
For this one, i think that the number of operations written by big-oh operations is O(n^2)
for (i=1;i<n;++i)
{
...statements that require at most 10^9 /i operations
}
For this one, i do not understand the meaning of "at most 10^9 /i operations". Hope someone give me some suggestions. Thx.
- 01-24-2011, 04:12 PM #2
If you are calculating for the worst case, then you assume the inner statement uses 10^9/i operations. It depends on wether you are calculating for best, average or worst case performance - generally you consider worst case since in some algorithms, its a deal breaker even if unlikely.
- 01-24-2011, 04:20 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,392
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Help with postfix expression
By javajavajava in forum New To JavaReplies: 3Last Post: 11-12-2010, 11:11 AM -
Help with regular expression
By mr.ab18 in forum New To JavaReplies: 2Last Post: 08-06-2010, 10:01 PM -
JSF expression inside another JSF expression
By barbarabxl in forum JavaServer Faces (JSF)Replies: 2Last Post: 05-21-2010, 03:03 PM -
regular expression
By ras_pari in forum Advanced JavaReplies: 27Last Post: 10-07-2009, 12:25 PM -
Quick reg. expression help
By RR_QQ in forum New To JavaReplies: 4Last Post: 02-10-2009, 07:51 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks