function C(fl, k)
if k 0 or 1< = n then return 1
elsereturn C(fl—1,k—1)+C(fl—1,k)


Analyse the time taken by this algorithm under the (unreasonable) assumption that the addition C(fl — 1, k — 1)+C(fl —1, k) can be carried out in constant time once both C(fl —1, k —1) and C(n —1, k) havebeen obtained recursively.Let t(n) denote the worst time that a call on C(fl, k) may take for all possible values 0f k, 0<= k <= n. Express t(n) in the simplest possible form in thete notation.

Recommended Answers

All 4 Replies

We're not here to do your homework. Try it yourself first.

It depends on your numeric representation.

It depends on your numeric representation.

thanks for the hint

We're not here to do your homework. Try it yourself first.

i have not asked for the answer just give me a hint

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.