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 15:00
You put the following items into your rucksack. ham 600 g cheese 380 g tomatoes 270 g how much do all the ingredients weigh in total?
Answers: 1
question
Mathematics, 21.06.2019 19:10
If $740 is invested at an interest rate of 11% per year and is compounded continuously, how much will the investment be worth in 7 years? use the continuous compound interest formula a = pert.
Answers: 1
question
Mathematics, 21.06.2019 23:30
Asap (i need to finish this quick) graph complete the sequence of transformations that produces △x'y'z' from △xyz. a clockwise rotation ° about the origin followed by a translation units to the right and 6 units down produces δx'y'z' from δxyz.
Answers: 1
question
Mathematics, 22.06.2019 00:30
Taber invested money in an account where interest is compounded every year.he made no withdrawals or deposits. the function a(t)=525(1+0.05)^t represent the amount of money in the account after t years. how much money did taber origanally invested?
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
Arts, 28.04.2021 18:30
question
Mathematics, 28.04.2021 18:30
question
World Languages, 28.04.2021 18:30