Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are a merchant travelling with a cart in the preindustrial era. You currently have a wagon of various goods with values stored in an

image text in transcribed

You are a merchant travelling with a cart in the preindustrial era. You currently have a wagon of various goods with values stored in an array A. Each of these goods you plan on selling in a different city (for maximum profit), but you can visit cities in any order (the geography of the area makes them all equally distant). When you enter each city to sell the associated good, you must pay a tax of 10% your total current money (not including value of trade goods). You may assume you start with O money. Describe or write loose pseudo-code for an algorithm to maximize your profit. (In other words what order should you sell all your goods.) Make sure to prove that your proposed selling strategy is the best. Sample array A: A = [ 40, 20, 90, 10, 5] So item 1 can be sold in city 1 for 40 money. Item 2 can be sold in city 2 for 20 money

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

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

What is a moving-average crossover rule?

Answered: 1 week ago