GATE CSE
First time here? Checkout the FAQ!
x
0 votes
107 views

Loading Question

asked in Algorithms by Veteran (10.2k points)   | 107 views
Hey guys ignore the options. What will be the answer by solving the relation?

more appropriate O(qn).

2 Answers

+2 votes

since p and q are constant ...q can have maximum constant value can go upto n....so the second part of the recurrence will give higher order .

so the order can be n^n(option b)

answered by Boss (9.7k points)  
0 votes
we can apply master theoram

a=8 b=2

k=0

a>b^k

so TC= O(n^3)
answered by Boss (8.2k points)  
You'r doing it wrong.
Why didn't you considered term $q^n$.

Let, q = 2;

then, $T(n)  = 8*T(\frac{n}{2}) + 2^n$, which is upper-bounded by $n^n$ only.

Should not option is O(qn). since we dont take heigher value for big-oh.

question is wrong . If it was qn inplace of qn, then C is right .

otherwise O( qn) is more appropriate.

Agree O( 2n) is far far less than O(nn) . 



Top Users Apr 2017
  1. akash.dinkar12

    3508 Points

  2. Divya Bharti

    2542 Points

  3. Deepthi_ts

    2040 Points

  4. rude

    1966 Points

  5. Tesla!

    1768 Points

  6. Shubham Sharma 2

    1610 Points

  7. Debashish Deka

    1588 Points

  8. Arunav Khare

    1454 Points

  9. Kapil

    1424 Points

  10. Arjun

    1420 Points

Monthly Topper: Rs. 500 gift card

22,076 questions
28,040 answers
63,230 comments
24,135 users