Question: Question 5 : You are given a complete binary tree ( i . e . , all leaves are at the same level and the
Question : You are given a complete binary tree ie all leaves are at the same level and
the bottom level is full The levels are numbered ; ; ; : : : ; d and the number n of
nodes satises n d Each node u in this tree stores an integer valueu
A node u is called a local minimum if valueu is less than or equal to the values in its
neighboring nodes. In the example above, all local minima are colored red.
Describe a recursive algorithm that returns, in Olog n time, a local minimum in this
tree.
You may describe your algorithm in plain English or in pseudocode. Justify the correct
ness of your algorithm and explain why the running time is Olog n You may use any result
that was proven in class.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
