Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

important question C and E. thanks 3 Where'd He Go? Suppose we've planned to meet for dinner at a certain restaurant on a certain very

image text in transcribed

image text in transcribed

important question C and E. thanks

3 Where'd He Go? Suppose we've planned to meet for dinner at a certain restaurant on a certain very long street, but after you get there I send you a text saying I'm at another restaurant "up the street," but unfortunately I don't say what or where the restaurant is (there are lots and lots of them), and it's not really clear which direction I meant by "up"-and then your phone dies. For concreteness, assume the original restaurant is at location 0 on the real line, and the new restaurant is at some unknown distance L away, i.e., at location either +L or -L. And assume that if you walk any distance L' 2 L in the right direction you'll find me (e.g. you'll see my car parked out front). u travel to find me, and notice that D is going to depend on L. Say that an algorithm is O(L)-time if the total distance traveled is O(L). (All the walking you do, in whichever direction(s), is walking at the same pace.) Note that if you knew which direction I eventually traveling a total distance of exactly L until you me, (a) If you somehow knew what the value of L was but not which direction I went, you could guarantee you'd find me within worst-case time exactly 3L. How? (b) But unfortunately you don't know the value L. So give a simple e(L2)-time algorithm to find me. (I said e, so seriously, Irn not kidding: give a (L2)-time algorithm, not a (L)-time 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_2

Step: 3

blur-text-image_3

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions