CMSC132 EXAM WITH FULL PACK
SOLUTIONS!!!!!!!!
Recursion B- B Bcorrect Banswer-A Bstrategy Bfor Bsolving Bproblems Bwhere Ba
Bmethod Bcalls Bitself
Recursion Brelies Bon Bthe Bruntime Bcall Bstack
B'every Bmethod Binvocation Bgets Bits Bown Bstack Bspace
Tail Brecursion B- B Bcorrect Banswer--Single Brecursive Bcall Bthats Bthe Blast Bthing
Bperformed Bin Bthe Bmethod
B'can Beasily Bbe Bturned Binto Ba Bloop
Non-tail Brecursion B- B Bcorrect Banswer--The Brecursive Bcall Bare Bnot Bperformed
Blast Bin Bthe Bmethod
Recursion Bvs. BIteration B- B Bcorrect Banswer--Iterative Bare Bmore Befficient B
B'b/c Bit Bavoids Bthe Boverhead Brecursive Bmethod Bcalls
-Recursive Balgorithms
B'have Bhigher Boverhead
B'sometimes Bsimpler
B'are Bnatural Bfor Bbacktracking Bsearches
B'suited Bfor Brecursive Bdata Bstructures
Trees B- B Bcorrect Banswer--Recursive Bdata Bstructure Bthat Bhave Ba Bone-to-many
Brelationship Bbetween Belements
Root B- B Bcorrect Banswer-No Bparent
SOLUTIONS!!!!!!!!
Recursion B- B Bcorrect Banswer-A Bstrategy Bfor Bsolving Bproblems Bwhere Ba
Bmethod Bcalls Bitself
Recursion Brelies Bon Bthe Bruntime Bcall Bstack
B'every Bmethod Binvocation Bgets Bits Bown Bstack Bspace
Tail Brecursion B- B Bcorrect Banswer--Single Brecursive Bcall Bthats Bthe Blast Bthing
Bperformed Bin Bthe Bmethod
B'can Beasily Bbe Bturned Binto Ba Bloop
Non-tail Brecursion B- B Bcorrect Banswer--The Brecursive Bcall Bare Bnot Bperformed
Blast Bin Bthe Bmethod
Recursion Bvs. BIteration B- B Bcorrect Banswer--Iterative Bare Bmore Befficient B
B'b/c Bit Bavoids Bthe Boverhead Brecursive Bmethod Bcalls
-Recursive Balgorithms
B'have Bhigher Boverhead
B'sometimes Bsimpler
B'are Bnatural Bfor Bbacktracking Bsearches
B'suited Bfor Brecursive Bdata Bstructures
Trees B- B Bcorrect Banswer--Recursive Bdata Bstructure Bthat Bhave Ba Bone-to-many
Brelationship Bbetween Belements
Root B- B Bcorrect Banswer-No Bparent