Results 1 to 2 of 2
  1. #1
    bMorgan is offline Member
    Join Date
    Nov 2010
    Posts
    9
    Rep Power
    0

    Default An algorithm problem

    I want to find a function f(n) that is both O(n) and O(nlogn). I think f(n) can be f(n) = n. Is that true?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,526
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by bMorgan View Post
    I want to find a function f(n) that is both O(n) and O(nlogn). I think f(n) can be f(n) = n. Is that true?
    if O(n) == O(n*log(n)) then O(1) == O(log(n)).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Algorithm Problem
    By Aggy in forum New To Java
    Replies: 4
    Last Post: 01-21-2010, 11:00 PM
  2. Problem with click to move ball algorithm
    By Laythe in forum Java Applets
    Replies: 1
    Last Post: 12-19-2009, 12:00 AM
  3. Problem with equation in my algorithm
    By romina in forum New To Java
    Replies: 2
    Last Post: 07-20-2007, 07:53 AM
  4. Problem with algorithm
    By Albert in forum AWT / Swing
    Replies: 1
    Last Post: 07-13-2007, 03:31 PM
  5. Algorithm problem
    By Marcus in forum Advanced Java
    Replies: 2
    Last Post: 07-01-2007, 01:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •