Write down the control abstractions for the divide-and-conquer strategy.
Subject Algorithm Design
NU Year Set: 4.(a) Marks: 5 Year: 2008
Control abstraction for Divide and conquer algorithm
 DAndC(P)    
 if Small(P) then
 return S(P);     
else     
{        
 divide P into smaller instances P1,P2..Pk,                                                             
 k>=1        
apply DAndC to each of these sub problems;       
 return 
Combine(DAndC(P1), DAndC(P2)….      
  DAndC(Pk));
     }
 

 

Login to post your comment.