Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A submarine is ordered to patrol between two ports. Assume the locations along the patrol route are identified by consecutive integers between 0 (for the

image text in transcribed

image text in transcribed

A submarine is ordered to patrol between two ports. Assume the locations along the patrol route are identified by consecutive integers between 0 (for the first port) and n (for the other port). One way for the submarine to hide is to settle on the bottom in a "sea valley" where the depth at that location is greater than the depths of both adjacent locations. The submarine may determine the depth at its current location by performing a "depth survey" that is somewhat expensive. The returned depth for the location will be a non-negative number, with larger numbers indicating deeper depths. Since the ports have adjacent locations on only one side, they do not qualify as "sea valleys". Furthermore assume e the depth at both ports is 0 e the depth at the other locations is positive . adjacent locations always have different depths First (9 pts): Create a divide and conquer algorithm for finding a "sea valley" (a location whose depth is greater than the adjacent locations) that requires only O(log n) depth surveys in the worst case (any sea valley will do, it need not be the first or deepest). State your algorithm, argue that it is correct, derive the recurrence for the number of depth surveys needed, and then bound the recurrence. Measure the cost of your algorithm in "depth surveys" and ignore the time to sail between locations. Second (1 pt): Assume that the submarine starts out at location 0, and runs your algorithm by sailing to each requested depth survey location in turn, and the locations are evenly spaced at one unit apart. Get a good asymptotic bound on how far the submarine might have to sail (as a function of n) when using your algorithm

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions

Question

understand the meaning of the terms discipline and grievance

Answered: 1 week ago