Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need a solution for this in Python. Thanks in advance! *40. Congratulations! You've been hired by the giant online bookstore DeNile (Not just a

image text in transcribed

I need a solution for this in Python. Thanks in advance!

*40. Congratulations! You've been hired by the giant online bookstore DeNile (Not just a river in Egypt!) to optimize their warehouse robots. Each book that DeNile sells has a unique ISBN (International Standard Book Number), which is just a numerical value. Each of DeNile's warehouses contains a long row of bins, each containing multiple copies of a single book. These bins are arranged in sorted order by ISBN; each bin's ISBN is printed on the front of the bin in machine-readable form. Books are retrieved from these bins by robots, which run along rails parallel to the row of bins. DeNile does not maintain a list of which bins contain which ISBN numbers; that would be too simple! Instead, to retrieve a desired book, the robot must first find that book's bin using a binary search. Because the search requires physical motion by the robot, we can no longer assume that each step of the binary search requires O(1) time. Specifically: The robot always starts at the Oth bin" (where the books are loaded into boxes to ship to customers). Exer Moving the robot from the ith bin to the jth bin requires ali- j| seconds for some constant a. The robot must be directly in front of a bin in order to read that bin's ISBN. Reading an ISBN requires 3 seconds, for some constant B. Reversing the robot's direction of motion (from increasing to decreasing or vice versa) requires y additional seconds, for some constant y. When the robot finds the target bin, it extracts one book from that bin and returns to "the oth bin. Design and analyze an algorithm to compute a binary search tree over the bins that minimizes the total time the robot spends searching for books. Your input is an array f[1.. n] of integers, where f[i] is the number of times that the robot will be asked to retrieve a book from the ith bin, along with the time parameters a, b, and y. *40. Congratulations! You've been hired by the giant online bookstore DeNile (Not just a river in Egypt!) to optimize their warehouse robots. Each book that DeNile sells has a unique ISBN (International Standard Book Number), which is just a numerical value. Each of DeNile's warehouses contains a long row of bins, each containing multiple copies of a single book. These bins are arranged in sorted order by ISBN; each bin's ISBN is printed on the front of the bin in machine-readable form. Books are retrieved from these bins by robots, which run along rails parallel to the row of bins. DeNile does not maintain a list of which bins contain which ISBN numbers; that would be too simple! Instead, to retrieve a desired book, the robot must first find that book's bin using a binary search. Because the search requires physical motion by the robot, we can no longer assume that each step of the binary search requires O(1) time. Specifically: The robot always starts at the Oth bin" (where the books are loaded into boxes to ship to customers). Exer Moving the robot from the ith bin to the jth bin requires ali- j| seconds for some constant a. The robot must be directly in front of a bin in order to read that bin's ISBN. Reading an ISBN requires 3 seconds, for some constant B. Reversing the robot's direction of motion (from increasing to decreasing or vice versa) requires y additional seconds, for some constant y. When the robot finds the target bin, it extracts one book from that bin and returns to "the oth bin. Design and analyze an algorithm to compute a binary search tree over the bins that minimizes the total time the robot spends searching for books. Your input is an array f[1.. n] of integers, where f[i] is the number of times that the robot will be asked to retrieve a book from the ith bin, along with the time parameters a, b, and y

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions