Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, the code must be written in python. Thanks 1. 20 pts. Consider a computer game with a 2D map with axes A(A1,A2,,An) and B(B1,B2,,Bm).

Hello, the code must be written in python. Thanks

image text in transcribed

1. 20 pts. Consider a computer game with a 2D map with axes A(A1,A2,,An) and B(B1,B2,,Bm). The goal is to start from A1B1, move step by step to arrive at AnBm, and reach the highest possible score. At each coordinate the player arrives, they gain a (positive) number of game points. Additionally, there is a rule that restricts the movements. If the player is at AiBj, their next move should be either AiBj+1 or Ai+1Bj, and no other movement is possible. Example: Input: n=4,m=3 Game map: Output: Route: A1B1A2B1A2B2A3B2A3B3A4B3 Points: 25+45+15+88+15+23=211 Design a brute-force algorithm to find the sequence of steps to reach the maximum number of total points. 3. Consider a game with n players {P1,P2,,Pn}. The players are lined up circularly and at each step, a player eliminates the nearest player on their left. The game starts with P1 's move. P1 eliminates P2. Then the next player in the line, P3, makes a move and eliminates P4. In the end, only one player is left and that player wins the game. Examine the following examples to understand the game better. Example: n=7 (a) 10 pts. Design an algorithm that finds the winner of the game, by using a circular linked list. Make sure your algorithm runs in linear time. (b) 20 pts. Design a decrease-and-conquer algorithm that finds the winner of the game. Make sure your algorithm runs in logarithmic time

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

More Books

Students also viewed these Databases questions