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

Loading Question

asked in Algorithms by Veteran (10.5k points)   | 109 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.9k 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.4k 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 May 2017
  1. akash.dinkar12

    3578 Points

  2. pawan kumarln

    2314 Points

  3. Bikram

    1950 Points

  4. Arjun

    1852 Points

  5. sh!va

    1682 Points

  6. Debashish Deka

    1296 Points

  7. Devshree Dubey

    1282 Points

  8. Arunav Khare

    1122 Points

  9. Angkit

    1072 Points

  10. LeenSharma

    1028 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 May 29 - Jun 04
  1. Arunav Khare

    246 Points

  2. Arjun

    202 Points

  3. pawan kumarln

    108 Points

  4. Rupendra Choudhary

    94 Points

  5. Niharika 1

    90 Points


22,909 questions
29,243 answers
65,403 comments
27,745 users