0% found this document useful (0 votes)
79 views4 pages

Master Method Intui3on For The 3 Cases: Design and Analysis of Algorithms I

The document discusses three cases for analyzing algorithms based on the rate of subproblem proliferation (RSP) and rate of work shrinkage (RWS) per subproblem. 1) If RSP = RWS, the amount of work is the same at each recursion level and the runtime is often O(n log n). 2) If RSP < RWS, the amount of work decreases each level and most work is at the root, with a potential runtime of O(n). 3) If RSP > RWS, the amount of work increases each level and most work is at the leaves, with a potential runtime of O(number of leaves).

Uploaded by

Fuzzy Assassin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views4 pages

Master Method Intui3on For The 3 Cases: Design and Analysis of Algorithms I

The document discusses three cases for analyzing algorithms based on the rate of subproblem proliferation (RSP) and rate of work shrinkage (RWS) per subproblem. 1) If RSP = RWS, the amount of work is the same at each recursion level and the runtime is often O(n log n). 2) If RSP < RWS, the amount of work decreases each level and most work is at the root, with a potential runtime of O(n). 3) If RSP > RWS, the amount of work increases each level and most work is at the leaves, with a potential runtime of O(number of leaves).

Uploaded by

Fuzzy Assassin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Master

 Method  
Intui3on  for  
the  3  Cases  
Design  and  Analysis  
of  Algorithms  I  
Tim  Roughgarden  
How  To  Think  About  (*)  
•     

Interpreta3on  
a  =  rate  of  subproblem  prolifera3on  (RSP)  
bd  =  rate  of  work  shrinkage  (RWS)  
                 (per  subproblem)  
Tim  Roughgarden  
Tem
Which  of  the  following  statements  are  true?                                                                         blo
(Check  all  that  apply.)     Ord
buL
If  RSP  <  RWS,  then  the  amount  of  work  is  decreasing  with  the   13  
24  
recursion  level  j.  
If  RSP  >  RWS,  then  the  amount  of  work  is  increasing  with  the  
recursion  level  j.  
No  conclusions  can  be  drawn  about  how  the  amount  of  work  varies  
with  the  recursion  level  j  unless  RSP  and  RWS  are  equal.  
If  RSP  and  RWS  are  equal,  then  the  amount  of  work  is  the  same  at  
every  recursion  level  j.  
Intui3on  for  the  3  Cases  
•     

1.  RSP  =  RWS  =>  Same  amount  of  work  each  level  (like  
Merge  Sort)      [expect  O(ndlog(n)]  
2.  RSP  <  RWS  =>  less  work  each  level  =>  most  work  at  the  
root        [might  expect  O(nd)]  
3.  RSP  >  RWS  =>  more  work  each  level  =>  most  work  at  
the  leaves        [might  expect  O(#  leaves)]  
Tim  Roughgarden  

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy