Question
Solve the recurrence relation $T(n)=2 T(n / 2)+k \cdot n$ where $k$ is constant then $T(n)$ is(A) $O(\log n)$(B) $O(n \log n)$(C) $O(n)$(D) $O\left(n^{2}\right)$
Step 1
Step 1: Identify the type of recurrence relation This is a divide-and-conquer recurrence relation, as the problem of size n is divided into two subproblems of size n/2. Show more…
Show all steps
Your feedback will help us improve your experience
James Kiss and 83 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Solve the recurrence relation using master method: $T(n)=4 T(n / 2)+n^{2}$ (A) $\theta(n \log n)$ (B) $\theta\left(n^{2} \log n\right)$ (C) $\theta\left(n^{2}\right)$ (D) $\theta\left(n^{3}\right)$
Programming and Data Structures
Asymptotic Analysis
Find the solution of the recurrence relation $a_{n}=$ $2 a_{n-1}+3 \cdot 2^{n} .$
Advanced Counting Techniques
Solving Linear Recurrence Relations
Solve the recurrence relation $T(n)=n T^{2}(n / 2)$ with initial condition $T(1)=6$ when $n=2^{k}$ for some integer $k .$ $\left[\text { Hint: Let } n=2^{k} \text { and then make the substitution } a_{k}=\right.$ $\log T\left(2^{k}\right)$ to obtain a linear nonhomogeneous recurrence relation. $]$
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD