You and your eight-year-old nephew elmo decide to play a

Assignment Help Data Structure & Algorithms
Reference no: EM13380247

You and your eight-year-old nephew Elmo decide to play a simple card game. Atthe beginning of the game, the cards are dealt face up in a long row. Each card isworth a different number of points. After all the cards are dealt, you and Elmo taketurns removing either the leftmost or rightmost card from the row, until all the cardsare gone. At each turn, you can decide which of the two cards to take. The winner ofthe game is the player that has collected the most points when the game ends.Having never taken an algorithms class, Elmo follows the obvious greedystrategy-when it's his turn, Elmo always takes the card with the higher point value.Your task is to find a strategy that will beat Elmo whenever possible. (It might seemmean to beat up on a little kid like this, but Elmo absolutely hates it when grown-upslet him win.)

(a) Prove that you should not also use the greedy strategy. That is, show that thereis a game that you can win, but only if you do not follow the same greedy strategy as Elmo.

(b) Describe and analyze an algorithm to determine, given the initial sequence ofcards, the maximum number of points that you can collect playing against Elmo.

(c) Five years later, Elmo has become a much stronger player. Describe and analyze an algorithm to determine, given the initial sequence of cards, the maximum number of points that you can collect playing against a perfectopponent

Reference no: EM13380247

Questions Cloud

Wireless networksconsider a warehouse that is 60m by 30m : wireless networksconsider a warehouse that is 60m by 30m. wireless networking is required so that up to 20 staff
1 ascii code is a fixed-length coding scheme using the : 1. ascii code is a fixed-length coding scheme. using the 7-bit ascii code table 3 or any other references find the
The data encryption standard des is a symmetric-key : the data encryption standard des is a symmetric-key algorithm for the encryption of electronic data which you
From your study of asymmetric and symmetric key : from your study of asymmetric and symmetric key cryptography use your own words to compare between them in terms of1.
You and your eight-year-old nephew elmo decide to play a : you and your eight-year-old nephew elmo decide to play a simple card game. atthe beginning of the game the cards are
Write a paper discussing threads vs processes what is a : write a paper discussing threads vs processes. what is a thread? what is a process? how are they different? how are
Write two page paper describing xml and json what are they : write two page paper describing xml and json. what are they? why do we need them? are there certain applications that
1 with what kind of network device router or switch do you : 1 with what kind of network device router or switch do you replace device 1 device 2 and device 3? and why? notenbsp
Study carefully the following network topology it is : study carefully the following network topology. it is required that the small business smart office services pty ltd

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Question about java programming

Define a class named Document that have an instance variable of type String named text that stores any textual content for the file. Design a technique named toString that returns the text field and also include a method to set this value.

  Creating an idef1x diagram

Construct an IDEF1X diagram that demonstrate only entities and relationships. Name each relationship and specify its cardinalities.

  Creating algorithm to implement function

Create an Algorithm to implement the given function and explain how the required task can be achieved in a step by step process.

  Cost control techniques

Assume your company has just completed the Initiation Process for implementing an Email System Upgrade. It was identified in a recent meeting with management leaders from the Sales,

  The definitions associated with graphs.

Understand the definitions associated with graphs. a. Connected undirected graph; loop and cycle; DAG; simple path; strongly connected graph; weakly connected graph; complete graph

  Write algorithm to find median value using queries

As queries are expensive, you would like to calculate median using as few queries as possible. Provide the algorithm which finds median value using at most O(log n) queries.

  What is difference between a state graph and a search tree

Describe how the problem of traveling from one city to another could be framed as a production system. What are the states? What are the productions?

  Explain method for combining two trees-heap-order property

Assume two binary trees, T 1 and T 2 , hold entries satisfying heap-order property. Explain method for combining T 1 and T 2 into a tree T whose internal nodes hold union of entries

  How the two versions of the algorithm compare

A brief introduction of the sorting algorithm that you have selected and how the two versions of the algorithm compare.

  Develop the pseudo code need

Develop the pseudo code needed to find the average of ten 8-bit numbers. Use a loop.

  Write an algorithm that takes a sequence of real numbers

Write an algorithm that takes a sequence of real numbers s and its length n and returns the absolute value of the average of these numbers.

  Create a binary search tree program

Creating a Binary Search Tree program - Finding the largest and smallest values in the tree Add two class methods

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