Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started