Lookup of information in constant time

Assignment Help Business Management
Reference no: EM132400873

Aisha is playing a game where she controls a character to catch pancakes falling onto a stage.

  • The character can move left and right on a stage of length n. The character's location x is in the range {1, 2, ....., n}. Let Xt by the location of the character at time t. At each second, Aisha can move the character to the left (Xt + 1 = Xt - 1) one step, to the right (Xt+1 = Xt +1) one step, or stay in the same spot (Xt+1 = Xt).

(Exceptions: can't move left when current X = 1 and can't move right when X = n.)

  • The game lasts m seconds.
  • Aisha knows the game really well, so she knows when and where pancakes will fall, i.e. pairs (t,p), which means at t seconds, a pancake will be at position p. You are given this, and assume lookup of this information in constant time.

The character starts at location 1 at time 0. Please design an algorithm to find out the most pancakes Aisha can catch. It should run in O(mn) time - please also justify why.

Example: (t, p) sequence: (1, 1), (2, 2), (3, 4), (3, 5), (4, 3), (4,4), (5, 2)). Optimal solution: 4 pancakes. Aisha can stay still for first step (X1 = 1) and catch pancake, move right (X2 = 2) and catch pancake, stay still (X3 = 2) then move right (X4 = 3) and catch pancake, and move left at (X5 = 2) and catch pancake.

Reference no: EM132400873

Questions Cloud

Amazon web services : What kinds of problems or challenges do we have with Amazon Web Services? What makes it a better solution than other cloud platforms?
What is the corresponding private key : Suppose that you want to send Alice the plaintext p = 3. What is the resulting ciphertext c, of encrypting this plaintext using Alice's public key?
What is the purpose of patch management : Non-IT professionals, however, may question the resources dedicated to ensuring proper patch management.
Was there a problem that you wanted to fix in your community : Why were you inspired to act? What did you learn from your effort? How did your actions benefit others, the wider community or both?
Lookup of information in constant time : Aisha knows the game really well, so she knows when and where pancakes will fall, i.e. pairs (t,p), which means at t seconds, a pancake will be at position p.
Main steps in system installation using the cloud : Describe the main steps in system installation using the Cloud. Also describe the challenges and benefits of using the Cloud.
MTS 3013 STRUCTURED PROGRAMMING- Assignment Problem : MTS 3013 STRUCTURED PROGRAMMING Assignment Help and Solutions, Sultan Idris Education University, Malaysia-Calculate the price that has to be paid by customer.
Bell-lapadula confidentiality model : The Bell-LaPadula confidentiality model includes the *-property, also described as "no write down." What kind of security breach is the *-property intended
How does blocking outgoing packets not having a source : How does blocking outgoing packets not having a source address in one's own address space improve security?

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd