Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Let T be a binary tree with n vertices. Deleting any vertex v splits T into at most three subtrees, containing the left child of
Let T be a binary tree with n vertices. Deleting any vertex v splits T into at most three subtrees, containing the left child of v(if any), the right child of v(if any), and the parent of v(if any). We call v a central vertex if each of these smaller trees has at most n/2 vertices. See the figure below for an example
(a) Prove that every tree has a central vertex (this should help you design a good divide- and-conquer strategy). (b) Describe a divide-and-conquer algorithm that finds a central vertex in an arbitrary given binary tree (you may not assume the tree is balanced, full, etc). You should write a short paragraph with the high-level English description plus provide clear pseudocode. (c) Prove your algorithm from part (b) is correct. (d) Give an argument (not a formal proof) for your algorithm's worst-case asymptotic run- time complexity. 34 14 7 12 (a) Prove that every tree has a central vertex (this should help you design a good divide- and-conquer strategy). (b) Describe a divide-and-conquer algorithm that finds a central vertex in an arbitrary given binary tree (you may not assume the tree is balanced, full, etc). You should write a short paragraph with the high-level English description plus provide clear pseudocode. (c) Prove your algorithm from part (b) is correct. (d) Give an argument (not a formal proof) for your algorithm's worst-case asymptotic run- time complexity. 34 14 7 12Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started