RunningTime Flashcards

1
Q

Prove using induction that T(n) = 2T(n/2)+n, T(1)=1 is O(nlogn).

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is it wrong?

A
  • It is wrong because we need to prove the exact form of the inductive hypothesis.*
  • That is, that T(n)<=cn*
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  • Given that T(n) = 2T(n/2)+n is O(nlogn)*
  • Find the running time of the attached recursion.*
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

define exactly a “tight bound”, using f(n) is in Omega(g(n))

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define in-place algorithm.

A

An algorithm which stores only a constant number of elements of the input array outside the array.

That is, it uses O(1) additional memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain the master theorem

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Solve T(n) = T(n/3) + T(2n/3) + cn using recursion tree

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Using recursive tree method

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly