SlideShare a Scribd company logo
3
Most read
10
Most read
11
Most read
Analysis of Algorithms
CS 477/677
Recurrences
Instructor: George Bebis
(Appendix A, Chapter 4)
2
Recurrences and Running Time
• An equation or inequality that describes a function in terms of
its value on smaller inputs.
T(n) = T(n-1) + n
• Recurrences arise when an algorithm contains recursive calls
to itself
• What is the actual running time of the algorithm?
• Need to solve the recurrence
– Find an explicit formula of the expression
– Bound the recurrence by an expression that involves n
3
Example Recurrences
• T(n) = T(n-1) + n Θ(n2
)
– Recursive algorithm that loops through the input to
eliminate one item
• T(n) = T(n/2) + c Θ(lgn)
– Recursive algorithm that halves the input in one step
• T(n) = T(n/2) + n Θ(n)
– Recursive algorithm that halves the input but must
examine every item in the input
• T(n) = 2T(n/2) + 1 Θ(n)
– Recursive algorithm that splits the input into 2 halves
and does a constant amount of other work
4
Recurrent Algorithms
BINARY-SEARCH
• for an ordered array A, finds if x is in the array A[lo…hi]
Alg.: BINARY-SEARCH (A, lo, hi, x)
if (lo > hi)
return FALSE
mid ← (lo+hi)/2
if x = A[mid]
return TRUE
if ( x < A[mid] )
BINARY-SEARCH (A, lo, mid-1, x)
if ( x > A[mid] )
BINARY-SEARCH (A, mid+1, hi, x)
12111097532
1 2 3 4 5 6 7 8
mid
lo hi
5
Example
• A[8] = {1, 2, 3, 4, 5, 7, 9, 11}
– lo = 1 hi = 8 x = 7
mid = 4, lo = 5, hi = 8
mid = 6, A[mid] = x Found!119754321
119754321
1 2 3 4 5 6 7 8
8765
6
Another Example
• A[8] = {1, 2, 3, 4, 5, 7, 9, 11}
– lo = 1 hi = 8 x = 6
mid = 4, lo = 5, hi = 8
mid = 6, A[6] = 7, lo = 5, hi = 5119754321
119754321
1 2 3 4 5 6 7 8
119754321 mid = 5, A[5] = 5, lo = 6, hi = 5
NOT FOUND!
119754321
low high
low
lowhigh
high
7
Analysis of BINARY-SEARCH
Alg.: BINARY-SEARCH (A, lo, hi, x)
if (lo > hi)
return FALSE
mid ← (lo+hi)/2
if x = A[mid]
return TRUE
if ( x < A[mid] )
BINARY-SEARCH (A, lo, mid-1, x)
if ( x > A[mid] )
BINARY-SEARCH (A, mid+1, hi, x)
• T(n) = c +
– T(n) – running time for an array of size n
constant time: c2
same problem of size n/2
same problem of size n/2
constant time: c1
constant time: c3
T(n/2)
8
Methods for Solving Recurrences
• Iteration method
• Substitution method
• Recursion tree method
• Master method
9
The recursion-tree method
Convert the recurrence into a tree:
– Each node represents the cost incurred at various levels
of recursion
– Sum up the costs of all levels
Used to “guess” a solution for the recurrence
10
Example 1
W(n) = 2W(n/2) + n2
• Subproblem size at level i is: n/2i
• Subproblem size hits 1 when 1 = n/2i
⇒ i = lgn
• Cost of the problem at level i = (n/2i
)2
No. of nodes at level i = 2i
• Total cost:
⇒ W(n) = O(n2
)
22
0
2
1lg
0
2lg
1lg
0
2
2)(
2
11
1
)(
2
1
2
1
)1(2
2
)( nnOnnOnnnW
n
nW
i
in
i
i
n
n
i
i
=+
−
=+





≤+





=+= ∑∑∑
∞
=
−
=
−
=
11
Example 2
E.g.: T(n) = 3T(n/4) + cn2
• Subproblem size at level i is: n/4i
• Subproblem size hits 1 when 1 = n/4i
⇒ i = log4n
• Cost of a node at level i = c(n/4i
)2
• Number of nodes at level i = 3i
⇒ last level has 3log
4
n
= nlog
4
3
nodes
• Total cost:
2
( ) ( ) ( ) )(
16
3
1
1
16
3
16
3
)( 23log23log2
0
3log2
1log
0
444
4
nOncnncnncnnT
i
iin
i
=Θ+
−
=Θ+





≤Θ+





= ∑∑
∞
=
−
=
12
Example 2 - Substitution
T(n) = 3T(n/4) + cn2
• Guess: T(n) = O(n2
)
– Induction goal: T(n) ≤ dn2
, for some d and n ≥ n0
– Induction hypothesis: T(n/4) ≤ d (n/4)2
• Proof of induction goal:
T(n) = 3T(n/4) + cn2
≤ 3d (n/4)2
+ cn2
= (3/16) d n2
+ cn2
≤ d n2
if: d ≥ (16/13)c
• Therefore: T(n) = O(n2
)
13
Example 3 (simpler proof)
W(n) = W(n/3) + W(2n/3) + n
• The longest path from the root to a
leaf is: n
→ (2/3)n → (2/3)2
n → … → 1
• Subproblem size hits 1 when 1 =
(2/3)i
n ⇔ i=log3/2n
• Cost of the problem at level i = n
• Total cost:
⇒ W(n) = O(nlgn)
3/ 2
lg
( ) ... (log ) ( lg )
3
lg
2
n
W n n n n n n O n n< + + = = =
14
Example 3
W(n) = W(n/3) + W(2n/3) + n
• The longest path from the root to a
leaf is: n
→ (2/3)n → (2/3)2
n → … → 1
• Subproblem size hits 1 when 1 =
(2/3)i
n ⇔ i=log3/2n
• Cost of the problem at level i = n
• Total cost:
⇒ W(n) = O(nlgn)
3/ 2
3 / 2
(log ) 1
(log )
0
( ) ... 2 (1)
n
n
i
W n n n n W
−
=
< + + = + <∑
3/ 2
3/ 2
log
log 2
3/ 2
0
lg 1
1 log ( ) ( ) lg ( )
lg3/ 2 lg3/ 2
n
i
n
n n n n O n n O n n n O n
=
< + = + = + = +∑
15
Example 3 - Substitution
W(n) = W(n/3) + W(2n/3) + O(n)
• Guess: W(n) = O(nlgn)
– Induction goal: W(n) ≤ dnlgn, for some d and n ≥
n0
– Induction hypothesis: W(k) ≤ d klgk for any K
< n (n/3, 2n/3)
• Proof of induction goal:
Try it out as an exercise!!
• T(n) = O(nlgn)

More Related Content

PPTX
Problem solving in Artificial Intelligence.pptx
kitsenthilkumarcse
 
PPTX
Insertion Sorting
FarihaHabib123
 
PPTX
Counting Sort
Faiza Saleem
 
PDF
7 Examples of C Program (Civil Engineering)
Faisal F Rafat
 
PPTX
Computer vision
Mahmoud Hussein
 
PPTX
Brute force method
priyankabhansali217
 
PPT
Solving systems of Linear Equations
swartzje
 
PPTX
Computer vision
Kartik Kalpande Patil
 
Problem solving in Artificial Intelligence.pptx
kitsenthilkumarcse
 
Insertion Sorting
FarihaHabib123
 
Counting Sort
Faiza Saleem
 
7 Examples of C Program (Civil Engineering)
Faisal F Rafat
 
Computer vision
Mahmoud Hussein
 
Brute force method
priyankabhansali217
 
Solving systems of Linear Equations
swartzje
 
Computer vision
Kartik Kalpande Patil
 

What's hot (20)

PPTX
Webinar : P, NP, NP-Hard , NP - Complete problems
Ziyauddin Shaik
 
PPTX
Parsing in Compiler Design
Akhil Kaushik
 
PDF
P, NP, NP-Complete, and NP-Hard
Animesh Chaturvedi
 
PDF
Algorithms Lecture 7: Graph Algorithms
Mohamed Loey
 
PPT
Np cooks theorem
Narayana Galla
 
PPTX
Merge Sort
Nikhil Sonkamble
 
PPTX
Context free grammar
Mohammad Ilyas Malik
 
DOC
Unit 3 daa
Nv Thejaswini
 
PPTX
Sum of subset problem.pptx
V.V.Vanniaperumal College for Women
 
PPTX
8 queens problem using back tracking
Tech_MX
 
PDF
Recurrence relation solutions
subhashchandra197
 
PPTX
Travelling salesman dynamic programming
maharajdey
 
PPTX
RECURSIVE DESCENT PARSING
Jothi Lakshmi
 
PPTX
Disjoint sets union, find
subhashchandra197
 
PPTX
Huffman Coding Algorithm Presentation
Akm Monir
 
PPT
Ll(1) Parser in Compilers
Mahbubur Rahman
 
PPTX
The n Queen Problem
Sukrit Gupta
 
PPT
Asymptotic Notation and Complexity
Rajandeep Gill
 
PPTX
Job sequencing with deadline
Arafat Hossan
 
PPTX
All pair shortest path
Arafat Hossan
 
Webinar : P, NP, NP-Hard , NP - Complete problems
Ziyauddin Shaik
 
Parsing in Compiler Design
Akhil Kaushik
 
P, NP, NP-Complete, and NP-Hard
Animesh Chaturvedi
 
Algorithms Lecture 7: Graph Algorithms
Mohamed Loey
 
Np cooks theorem
Narayana Galla
 
Merge Sort
Nikhil Sonkamble
 
Context free grammar
Mohammad Ilyas Malik
 
Unit 3 daa
Nv Thejaswini
 
Sum of subset problem.pptx
V.V.Vanniaperumal College for Women
 
8 queens problem using back tracking
Tech_MX
 
Recurrence relation solutions
subhashchandra197
 
Travelling salesman dynamic programming
maharajdey
 
RECURSIVE DESCENT PARSING
Jothi Lakshmi
 
Disjoint sets union, find
subhashchandra197
 
Huffman Coding Algorithm Presentation
Akm Monir
 
Ll(1) Parser in Compilers
Mahbubur Rahman
 
The n Queen Problem
Sukrit Gupta
 
Asymptotic Notation and Complexity
Rajandeep Gill
 
Job sequencing with deadline
Arafat Hossan
 
All pair shortest path
Arafat Hossan
 
Ad

Similar to Recursion tree method (20)

PPT
Recurrences
Ala' Mohammad
 
PPTX
2.pptx
MohAlyasin1
 
PPT
Master method
Rajendran
 
PPTX
3. D&C and Recurrence Relation.ppYtxVVVV
NetraBansal3
 
PPTX
Solving recurrences
Megha V
 
PDF
CS330-Lectures Statistics And Probability
bryan111472
 
PPT
Asymptotic analysis
Soujanya V
 
PPT
Divide and conquer
Vikas Sharma
 
PPT
5.2 divede and conquer 03
Krish_ver2
 
PPT
5.2 divede and conquer 03
Krish_ver2
 
PPTX
1_Asymptotic_Notation_pptx.pptx
pallavidhade2
 
PPT
recurrence relations in analysis of algorithm
vidhyapm2
 
PPT
AsymptoticAnalysis-goal of analysis of algorithms
DesiSmartCooking
 
PPT
03 dc
Hira Gul
 
PPT
5.2 divide and conquer
Krish_ver2
 
PDF
Unit-1 DAA_Notes.pdf
AmayJaiswal4
 
PPT
recurrence relation is explained in this
vidhyapm2
 
PPT
AsymptoticAnalysis.ppt
SiddheshUpadhyay3
 
PDF
module2_dIVIDEncONQUER_2022.pdf
Shiwani Gupta
 
PPTX
Lecture 3 complexity
Madhu Niket
 
Recurrences
Ala' Mohammad
 
2.pptx
MohAlyasin1
 
Master method
Rajendran
 
3. D&C and Recurrence Relation.ppYtxVVVV
NetraBansal3
 
Solving recurrences
Megha V
 
CS330-Lectures Statistics And Probability
bryan111472
 
Asymptotic analysis
Soujanya V
 
Divide and conquer
Vikas Sharma
 
5.2 divede and conquer 03
Krish_ver2
 
5.2 divede and conquer 03
Krish_ver2
 
1_Asymptotic_Notation_pptx.pptx
pallavidhade2
 
recurrence relations in analysis of algorithm
vidhyapm2
 
AsymptoticAnalysis-goal of analysis of algorithms
DesiSmartCooking
 
03 dc
Hira Gul
 
5.2 divide and conquer
Krish_ver2
 
Unit-1 DAA_Notes.pdf
AmayJaiswal4
 
recurrence relation is explained in this
vidhyapm2
 
AsymptoticAnalysis.ppt
SiddheshUpadhyay3
 
module2_dIVIDEncONQUER_2022.pdf
Shiwani Gupta
 
Lecture 3 complexity
Madhu Niket
 
Ad

More from Rajendran (20)

PPT
Element distinctness lower bounds
Rajendran
 
PPT
Scheduling with Startup and Holding Costs
Rajendran
 
PPT
Divide and conquer surfing lower bounds
Rajendran
 
PPT
Red black tree
Rajendran
 
PPT
Hash table
Rajendran
 
PPT
Medians and order statistics
Rajendran
 
PPT
Proof master theorem
Rajendran
 
PPT
Recurrence theorem
Rajendran
 
PPT
Master method theorem
Rajendran
 
PPT
Hash tables
Rajendran
 
PPT
Lower bound
Rajendran
 
PPT
Master method theorem
Rajendran
 
PPT
Greedy algorithms
Rajendran
 
PPT
Longest common subsequences in Algorithm Analysis
Rajendran
 
PPT
Dynamic programming in Algorithm Analysis
Rajendran
 
PPT
Average case Analysis of Quicksort
Rajendran
 
PPT
Np completeness
Rajendran
 
PPT
computer languages
Rajendran
 
PPT
proving non-computability
Rajendran
 
PPT
the halting_problem
Rajendran
 
Element distinctness lower bounds
Rajendran
 
Scheduling with Startup and Holding Costs
Rajendran
 
Divide and conquer surfing lower bounds
Rajendran
 
Red black tree
Rajendran
 
Hash table
Rajendran
 
Medians and order statistics
Rajendran
 
Proof master theorem
Rajendran
 
Recurrence theorem
Rajendran
 
Master method theorem
Rajendran
 
Hash tables
Rajendran
 
Lower bound
Rajendran
 
Master method theorem
Rajendran
 
Greedy algorithms
Rajendran
 
Longest common subsequences in Algorithm Analysis
Rajendran
 
Dynamic programming in Algorithm Analysis
Rajendran
 
Average case Analysis of Quicksort
Rajendran
 
Np completeness
Rajendran
 
computer languages
Rajendran
 
proving non-computability
Rajendran
 
the halting_problem
Rajendran
 

Recently uploaded (20)

PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PPTX
Autodock-for-Beginners by Rahul D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PDF
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PPT
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PDF
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
PDF
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
Autodock-for-Beginners by Rahul D Jawarkar.pptx
Rahul Jawarkar
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
CDH. pptx
AneetaSharma15
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 

Recursion tree method

  • 1. Analysis of Algorithms CS 477/677 Recurrences Instructor: George Bebis (Appendix A, Chapter 4)
  • 2. 2 Recurrences and Running Time • An equation or inequality that describes a function in terms of its value on smaller inputs. T(n) = T(n-1) + n • Recurrences arise when an algorithm contains recursive calls to itself • What is the actual running time of the algorithm? • Need to solve the recurrence – Find an explicit formula of the expression – Bound the recurrence by an expression that involves n
  • 3. 3 Example Recurrences • T(n) = T(n-1) + n Θ(n2 ) – Recursive algorithm that loops through the input to eliminate one item • T(n) = T(n/2) + c Θ(lgn) – Recursive algorithm that halves the input in one step • T(n) = T(n/2) + n Θ(n) – Recursive algorithm that halves the input but must examine every item in the input • T(n) = 2T(n/2) + 1 Θ(n) – Recursive algorithm that splits the input into 2 halves and does a constant amount of other work
  • 4. 4 Recurrent Algorithms BINARY-SEARCH • for an ordered array A, finds if x is in the array A[lo…hi] Alg.: BINARY-SEARCH (A, lo, hi, x) if (lo > hi) return FALSE mid ← (lo+hi)/2 if x = A[mid] return TRUE if ( x < A[mid] ) BINARY-SEARCH (A, lo, mid-1, x) if ( x > A[mid] ) BINARY-SEARCH (A, mid+1, hi, x) 12111097532 1 2 3 4 5 6 7 8 mid lo hi
  • 5. 5 Example • A[8] = {1, 2, 3, 4, 5, 7, 9, 11} – lo = 1 hi = 8 x = 7 mid = 4, lo = 5, hi = 8 mid = 6, A[mid] = x Found!119754321 119754321 1 2 3 4 5 6 7 8 8765
  • 6. 6 Another Example • A[8] = {1, 2, 3, 4, 5, 7, 9, 11} – lo = 1 hi = 8 x = 6 mid = 4, lo = 5, hi = 8 mid = 6, A[6] = 7, lo = 5, hi = 5119754321 119754321 1 2 3 4 5 6 7 8 119754321 mid = 5, A[5] = 5, lo = 6, hi = 5 NOT FOUND! 119754321 low high low lowhigh high
  • 7. 7 Analysis of BINARY-SEARCH Alg.: BINARY-SEARCH (A, lo, hi, x) if (lo > hi) return FALSE mid ← (lo+hi)/2 if x = A[mid] return TRUE if ( x < A[mid] ) BINARY-SEARCH (A, lo, mid-1, x) if ( x > A[mid] ) BINARY-SEARCH (A, mid+1, hi, x) • T(n) = c + – T(n) – running time for an array of size n constant time: c2 same problem of size n/2 same problem of size n/2 constant time: c1 constant time: c3 T(n/2)
  • 8. 8 Methods for Solving Recurrences • Iteration method • Substitution method • Recursion tree method • Master method
  • 9. 9 The recursion-tree method Convert the recurrence into a tree: – Each node represents the cost incurred at various levels of recursion – Sum up the costs of all levels Used to “guess” a solution for the recurrence
  • 10. 10 Example 1 W(n) = 2W(n/2) + n2 • Subproblem size at level i is: n/2i • Subproblem size hits 1 when 1 = n/2i ⇒ i = lgn • Cost of the problem at level i = (n/2i )2 No. of nodes at level i = 2i • Total cost: ⇒ W(n) = O(n2 ) 22 0 2 1lg 0 2lg 1lg 0 2 2)( 2 11 1 )( 2 1 2 1 )1(2 2 )( nnOnnOnnnW n nW i in i i n n i i =+ − =+      ≤+      =+= ∑∑∑ ∞ = − = − =
  • 11. 11 Example 2 E.g.: T(n) = 3T(n/4) + cn2 • Subproblem size at level i is: n/4i • Subproblem size hits 1 when 1 = n/4i ⇒ i = log4n • Cost of a node at level i = c(n/4i )2 • Number of nodes at level i = 3i ⇒ last level has 3log 4 n = nlog 4 3 nodes • Total cost: 2 ( ) ( ) ( ) )( 16 3 1 1 16 3 16 3 )( 23log23log2 0 3log2 1log 0 444 4 nOncnncnncnnT i iin i =Θ+ − =Θ+      ≤Θ+      = ∑∑ ∞ = − =
  • 12. 12 Example 2 - Substitution T(n) = 3T(n/4) + cn2 • Guess: T(n) = O(n2 ) – Induction goal: T(n) ≤ dn2 , for some d and n ≥ n0 – Induction hypothesis: T(n/4) ≤ d (n/4)2 • Proof of induction goal: T(n) = 3T(n/4) + cn2 ≤ 3d (n/4)2 + cn2 = (3/16) d n2 + cn2 ≤ d n2 if: d ≥ (16/13)c • Therefore: T(n) = O(n2 )
  • 13. 13 Example 3 (simpler proof) W(n) = W(n/3) + W(2n/3) + n • The longest path from the root to a leaf is: n → (2/3)n → (2/3)2 n → … → 1 • Subproblem size hits 1 when 1 = (2/3)i n ⇔ i=log3/2n • Cost of the problem at level i = n • Total cost: ⇒ W(n) = O(nlgn) 3/ 2 lg ( ) ... (log ) ( lg ) 3 lg 2 n W n n n n n n O n n< + + = = =
  • 14. 14 Example 3 W(n) = W(n/3) + W(2n/3) + n • The longest path from the root to a leaf is: n → (2/3)n → (2/3)2 n → … → 1 • Subproblem size hits 1 when 1 = (2/3)i n ⇔ i=log3/2n • Cost of the problem at level i = n • Total cost: ⇒ W(n) = O(nlgn) 3/ 2 3 / 2 (log ) 1 (log ) 0 ( ) ... 2 (1) n n i W n n n n W − = < + + = + <∑ 3/ 2 3/ 2 log log 2 3/ 2 0 lg 1 1 log ( ) ( ) lg ( ) lg3/ 2 lg3/ 2 n i n n n n n O n n O n n n O n = < + = + = + = +∑
  • 15. 15 Example 3 - Substitution W(n) = W(n/3) + W(2n/3) + O(n) • Guess: W(n) = O(nlgn) – Induction goal: W(n) ≤ dnlgn, for some d and n ≥ n0 – Induction hypothesis: W(k) ≤ d klgk for any K < n (n/3, 2n/3) • Proof of induction goal: Try it out as an exercise!! • T(n) = O(nlgn)