



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Comprehensive solutions to a cmsc132 exam, covering essential topics such as recursion, trees, and algorithm efficiency. It includes detailed explanations of concepts like tail recursion, tree traversals (dfs, bfs), binary search trees, and asymptotic analysis (big-o notation). The material is presented in a question-and-answer format, making it an excellent resource for students preparing for exams or seeking a deeper understanding of these fundamental computer science topics. Key concepts are clearly defined, and the document offers insights into algorithm benchmarking and performance analysis. It serves as a valuable study aid for mastering data structures and algorithm design.
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!




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 Leaf B- B Bcorrect Banswer-No Bchildren Interior BNodes B- B Bcorrect Banswer-A Bnode Bwith Bat Bleast Bone Bchild Siblings B- B Bcorrect Banswer-Have Bsame Bparent Descendants B- B Bcorrect Banswer-Reachable Bby Brepeated Bproceeding Bfrom Bparent Bto Bchild Subtree B- B Bcorrect Banswer-A Btree Bwhose Broot Bis Ba Bchild Level B- B Bcorrect Banswer-a Bmeasure Bof Ba Bnode's Bdistance Bfrom Bthe Broot Height B(or BDepth) B- B Bcorrect Banswer-the Bmaximum Blevel Bof Bany Bnode Bin Bthe Btree Binary BTree B- B Bcorrect Banswer-a Btree Bwith Bat Bmost Btwo Bchildren Bper Bnode Depth-First BTraversal B(DFS) B- B Bcorrect Banswer-visits Bnodes Bas Bfar Bahead Bas Bpossible Bbefore Bbacking Bup Preorder BTraversal B- B Bcorrect Banswer-visits Ba Bparents Bnode Bbefore Bits Bleft Band Bright Bchildren Inorder BTraversal B- B Bcorrect Banswer-visits Bnodes Bin Bthe Border Bleft Bchild, Bparent, Bright Bchild Postorder BTraversal B- B Bcorrect Banswer-visits Ba Bparents Bnode's Bleft Band Bright Bchildren Bbefore Bthe Bparents Bnode Bitself Breadth-Frist BTraversal B(BFS) B- B Bcorrect Banswer-visits Bnodes Baccording Bto Bhow Bfar Baway Bthey Bare Bfrom Bthe Broot Balanced BBinary BTree B- B Bcorrect Banswer-has Bmostly Btwo Bchildren Bper Bnode Degenerate BBinary BTree B- B Bcorrect Banswer-has Bmostly Bone Bchild Bper Bnode Binary BSearch BTree B(BST) B- B Bcorrect Banswer-a Bbinary Btree Bwith Bthe Bproperty Bthat Bthe Bvalue Bin Bevery Bnode Bis Blarger Bthan Ball Bthe Bvalues Bin Bits Bleft Bsubtree, Band Bsmaller Bthan Ball Bthe Bvalues Bin Bits Bright Bsubtree Polymorphic BBinary BSearch BTree B- B Bcorrect Banswer-a Btree Bcould Bbe Ban Binterface, Bor Ba Bsuperclass. BImplement Btwo Bsubclasses, BEmptyTree, BNoneEmptyTree
-MOST BUSEFULL Bmetric Bpractice B• BAverage Bcase- Baverage Bover Ball Bpossible Binputs, Bassuming Bthat Ball Binputs Bhave Bthe Bsame Blikelihood
Auxiliary BMethod B/ BHelper BMethod B- B Bcorrect Banswer-method Bthat Bis Bactually Brecursive Wrapper BMethod B- B Bcorrect Banswer-the Bmethod Bonly Bpurpose Bis Bto Bcall Bthe Brecursive Bmethod Band Breturn Bits Bresult