Share your knowledge at the LQ Wiki.
 Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org Big-O and Big-Omega Problem
 Programming This forum is for all programming questions. The question does not have to be directly related to Linux and any language is fair game.

Notices

 10-04-2010, 08:21 PM #1 jfhebb LQ Newbie   Registered: Oct 2010 Posts: 1 Rep: Big-O and Big-Omega Problem So, I have a problem to show an example of a positive function f(n) so f(n) is neither O(n) or Ω(n). Any help?
 10-04-2010, 11:01 PM #2 dugan LQ Guru   Registered: Nov 2003 Location: Canada Distribution: Slackware Posts: 7,434 Rep: I started writing an example (because this is an exceptionally easy question), but I thought better of it: doing your homework for you isn't right. Hint: it's really easy to come up with a function involving nested loops where the best case and the worst case are both n-squared. Last edited by dugan; 10-04-2010 at 11:03 PM.
 10-04-2010, 11:04 PM #3 Berhanie Senior Member   Registered: Dec 2003 Location: phnom penh Distribution: Fedora Posts: 1,625 Rep: without getting into details, the idea is this: start with f which is not O(n), and g which is not Ω(n). use those two functions to define another function h which is guaranteed to be neither O(n) nor Ω(n).

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post oulevon Programming 7 05-26-2010 07:18 AM VodkaRocks Linux - Wireless Networking 11 06-26-2009 07:08 AM LXer Syndicated Linux News 0 12-23-2007 01:20 PM basshead62887 Linux - Hardware 5 09-12-2007 12:33 AM rhonneil Linux - Software 2 09-25-2003 08:13 PM

LinuxQuestions.org

All times are GMT -5. The time now is 07:52 PM.

 Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap -