subject
Mathematics, 11.02.2020 21:50 animexcartoons209

You are given an n n matrix A with unknown values and your goal is to find an entry that is a local maximum with the smallest number of queries to individual entries. An entry Ai;j is a local maximum if it is not smaller than any of its neighbors (top, bottom, left or right if they exist) i. e. A(i, j) = max{ A(i, j), A(i-1,j), A(i, j-1), A(i+1,j), A(i, j+1)}. You only need to find a local maximum, not the global maximum. Note that there may be multiple local maxima.
1. Design an algorithm to find a local maximum in O(n) number of queries. (Hint: Start by thinking about a strategy for the 1D array first, and then extend it to the 2D setting.)
2. Prove the correctness of your algorithm.
3. Analyze the time complexity of your algorithm by finding a recurrence for the number of queries and solving it.

ansver
Answers: 2

Another question on Mathematics

question
Mathematics, 21.06.2019 14:40
What is the celsius temperature that is equal to 94 degrees fahrenheit using the formula f=9/5 c+32
Answers: 2
question
Mathematics, 21.06.2019 18:30
An arc subtends a central angle measuring 7pi/4 radians what fraction of the circumference is this arc?
Answers: 1
question
Mathematics, 22.06.2019 01:40
Shape a is congruent to shape , as shown by a reflection across the y-axis and then a translation down units. shape b is congruent to shape , as shown by a reflection across the y-axis and then a translation down units.
Answers: 2
question
Mathematics, 22.06.2019 02:00
Ineed on the last 8 questions for this homework i’m trying to get all this done by tuesday when i got to my level 5 teacher if i have passed my tabe
Answers: 1
You know the right answer?
You are given an n n matrix A with unknown values and your goal is to find an entry that is a local...
Questions
question
English, 07.12.2021 18:00
question
English, 07.12.2021 18:00
question
Mathematics, 07.12.2021 18:00
question
Health, 07.12.2021 18:00
question
Mathematics, 07.12.2021 18:00
Questions on the website: 13722367