Results 1 to 3 of 3

Thread: Algorithms Query

  1. #1
    Trying to make mom and pop proud
    Join Date
    Apr 2008
    Posts
    16
    Rep Power
    6


    Good post? Yes | No

    Lightbulb Algorithms Query



    i am getting the option a as the answer,but the correct answer is option d.

    Can someone explain!!!


    Thnks in advance

  2. #2
    Trying to make mom and pop proud
    Join Date
    Sep 2008
    Posts
    5
    Rep Power
    5


    Good post? Yes | No
    Hi,

    This problem can not be solved with Master Theorem, since it doesn't
    belong to any of the three cases(I guess you
    obtain (A) with Master Theorem).

    My way is to build a recursion tree:

    log(N)--------------------- log(N)
    log(N/2) log(N/2)-------- log(N)-2log2
    log(N/4) log(N/4) log(n/4) log(N/4)-- log(N)-4log4
    ............

    log(1) log(1) ... log(1)--------- log(N)*T(1)

    ----------------------------------------------------------
    total: O(log(N)*log(N))

    Hope it helps.
    Last edited by MagicTest2008!!!; 09-28-2008 at 07:49 PM.

  3. #3
    Eager!
    Join Date
    Aug 2010
    Posts
    74
    Rep Power
    3


    Good post? Yes | No
    You can use the Master Theorem on wikipedia Master theorem - Wikipedia, the free encyclopedia to get the formula (case-2 is different from that in CLRS).

    So, you have:
    if f(n) == n ^ log(base-b)(a) . (log n)^k (k >= 0) then:
    F(n) = (log n)^(k+1)

    According to that formula, you have: F(n) = (log n)^2

    [Thanks to nomind for this]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Data Structures and Algorithms and Computer Organisation and Archi
    By kooljay999 in forum GRE Computer Science
    Replies: 4
    Last Post: 07-06-2010, 04:14 PM
  2. Yahoo Competition for Learning-to-Rank Algorithms
    By CalmLogic in forum Computer Science Admissions
    Replies: 0
    Last Post: 04-15-2010, 04:40 PM
  3. question regarding sorting algorithms
    By juju in forum GRE Computer Science
    Replies: 1
    Last Post: 05-12-2007, 03:52 PM
  4. Genetic Algorithms (AI)
    By wood in forum GRE Computer Science
    Replies: 7
    Last Post: 11-03-2003, 03:54 PM
  5. Sorting Algorithms - Stable/Unstable
    By wood in forum GRE Computer Science
    Replies: 8
    Last Post: 11-02-2003, 04:15 PM

Bookmarks

Posting Permissions

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

SEO by vBSEO ©2010, Crawlability, Inc.